diff --git a/flake.lock b/flake.lock index 5bc1136..05d07d6 100644 --- a/flake.lock +++ b/flake.lock @@ -178,9 +178,30 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nvim": "nvim", + "sops-nix": "sops-nix", "wrappers": "wrappers_2" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1794624949, + "narHash": "sha256-3q/hxp/flW1PnV3Dx+H3p8kHGEHJ7251BqVMNsAAB9E=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "11e5885d241743ff0193465d533b20e754bc3ce0", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "wrappers": { "inputs": { "nixpkgs": "nixpkgs_3" diff --git a/flake.nix b/flake.nix index 8cb3561..555978d 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,11 @@ # My Nvim config nvim.url = "git+https://git.voidarc.co.uk/voidarc/nvim"; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Hyprland Configuration hyprland = { url = "git+https://git.voidarc.co.uk/adumh00man/hyprland-dendritic"; diff --git a/modules/attrs/desktop/default.nix b/modules/attrs/desktop/default.nix index dee17a9..3531fae 100644 --- a/modules/attrs/desktop/default.nix +++ b/modules/attrs/desktop/default.nix @@ -14,6 +14,7 @@ networking hyprland theming + sops ]; in { imports = modules; diff --git a/modules/features/sops/default.nix b/modules/features/sops/default.nix new file mode 100644 index 0000000..25c4dba --- /dev/null +++ b/modules/features/sops/default.nix @@ -0,0 +1,22 @@ +{inputs, ...}: { + flake.nixosModules.sops = { + pkgs, + config, + ... + }: { + imports = [inputs.sops-nix.nixosModules.default]; + + sops = { + age.keyFile = "/home/user01/Projects/dendritic-tutorial/age.txt"; + defaultSopsFile = ./secrets.yaml; + + secrets = { + secret = {}; + something = {}; + }; + templates = { + "secret-value.env".content = "${config.sops.placeholder.something}"; + }; + }; + }; +} diff --git a/modules/features/zsh/default.nix b/modules/features/zsh/default.nix index 08ac21d..5b38d3f 100644 --- a/modules/features/zsh/default.nix +++ b/modules/features/zsh/default.nix @@ -81,6 +81,7 @@ v = lib.getExe inputs'.nvim.packages.default; ff = lib.getExe pkgs.fastfetch; cat = lib.getExe pkgs.bat; + secret = "cat /run/secrets/secret-value"; }; # Can also be zshrc.path, and path will take precedence over content. zshrc.content = ''