From 37e982c983d01d9e8ccdef8fc92668d05576206c Mon Sep 17 00:00:00 2001 From: lsoriano-mcm Date: Sat, 28 Jun 2025 21:00:01 -0500 Subject: [PATCH] added SOPS --- .gitignore | 1 + config.nix | 8 ++++---- flake.lock | 21 +++++++++++++++++++++ flake.nix | 3 +++ home/desktop.nix | 6 +++--- hosts/desktop/configuration.nix | 2 ++ hosts/macos/darwin.nix | 4 +++- modules/desktop.nix | 8 ++++++-- secrets/secrets.yaml | 1 + 9 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 secrets/secrets.yaml diff --git a/.gitignore b/.gitignore index e69de29..8b13789 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ + diff --git a/config.nix b/config.nix index 1952d5b..e4100bf 100644 --- a/config.nix +++ b/config.nix @@ -60,17 +60,17 @@ gaming = true; vpn = { - Enable = true; + Enable = false; secretFile = builtins.toPath ./secrets/.vpn.yaml; }; touchpadSupport = false; - logitech-hardware.enable = false; + logitech-hardware.enable = true; # Custom Applications - linux-apps = { + apps = { gaming = true; - my-apps = pkgs: + apps = pkgs: with pkgs; [ jellyfin-media-player ]; diff --git a/flake.lock b/flake.lock index 8f4b2a5..5931853 100644 --- a/flake.lock +++ b/flake.lock @@ -892,6 +892,7 @@ "nix-gaming": "nix-gaming", "nixovim": "nixovim", "nixpkgs": "nixpkgs_3", + "sops-nix": "sops-nix", "unlisted-fonts": "unlisted-fonts" } }, @@ -913,6 +914,26 @@ "type": "github" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750119275, + "narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1689347949, diff --git a/flake.nix b/flake.nix index b94ba73..96dea89 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,9 @@ nix-gaming.url = "github:fufexan/nix-gaming"; nix-gaming.inputs.nixpkgs.follows = "nixpkgs"; + + sops-nix.url = "github:Mic92/sops-nix"; + sops-nix.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { diff --git a/home/desktop.nix b/home/desktop.nix index 5344b70..44e6a1d 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -1,12 +1,12 @@ -{username, ...}: { +{myConfig, ...}: { imports = [ ]; programs.home-manager.enable = true; home = { - username = "${username}"; - homeDirectory = "/home/${username}"; + username = "${myConfig.username}"; + homeDirectory = "/home/${myConfig.username}"; packages = []; sessionVariables = {}; }; diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 6d26bf7..2854a5c 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -2,9 +2,11 @@ pkgs, general, builds, + inputs, ... }: { imports = [ + inputs.sops-nix.nixosModules.sops # Include the results of the hardware scan. ]; diff --git a/hosts/macos/darwin.nix b/hosts/macos/darwin.nix index 6625ba2..4400954 100644 --- a/hosts/macos/darwin.nix +++ b/hosts/macos/darwin.nix @@ -1,10 +1,12 @@ { pkgs, myConfig, + inputs, ... }: { imports = [ ../../modules/dev.nix + inputs.sops-nix.darwinModules.sops ]; # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget @@ -34,7 +36,7 @@ users.users.${myConfig.general.Username} = { name = "${myConfig.general.Username}"; home = "/Users/${myConfig.general.Username}"; - shell = pkgs.${myConfig.general.terminal.Shell}; + # shell = pkgs.${myConfig.general.terminal.Shell}; # no support for nix-darwin, but can be changed via chsh. }; home-manager.users.${myConfig.general.Username} = import ../../home/macos.nix; diff --git a/modules/desktop.nix b/modules/desktop.nix index 240d3d6..e279b2b 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -1,6 +1,10 @@ -{lib, ...}: { +{ + lib, + myConfig, + ... +}: { imports = [ ] - ++ [lib.optionals (linux-apps.gamingDesktop == true)]; + ++ [lib.optionals (myConfig.linux.apps.gaming == true)]; } diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml new file mode 100644 index 0000000..397ec2c --- /dev/null +++ b/secrets/secrets.yaml @@ -0,0 +1 @@ +VPN_HAKASE_DEFAULT_PRIVATE_KEY: aa