added nixos.sops module
This commit is contained in:
@@ -4,35 +4,15 @@ let
|
|||||||
hostname = "test-nix";
|
hostname = "test-nix";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos."${hostname}" = { pkgs, lib, ...}: {
|
|
||||||
networking.hostName = "${hostname}";
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
# require public key authentication for better security
|
|
||||||
settings.PasswordAuthentication = false;
|
|
||||||
settings.KbdInteractiveAuthentication = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = with inputs.sops-nix.nixosModules; [
|
|
||||||
sops
|
|
||||||
];
|
|
||||||
|
|
||||||
sops.defaultSopsFile = ../../keys/secrets.yaml;
|
|
||||||
sops.secrets."test-nix/ssh_host_key" = {
|
|
||||||
owner = "john";
|
|
||||||
path = "/home/john/.ssh/host_key";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = with inputs.self.modules; [
|
modules = with inputs.self.modules; [
|
||||||
nixos."${hostname}"
|
|
||||||
nixos.lxc
|
nixos.lxc
|
||||||
|
nixos.sops
|
||||||
|
nixos.step-client
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
nixos."${username}"
|
nixos."${username}"
|
||||||
nixos.zsh
|
nixos.zsh
|
||||||
nixos.docker
|
nixos.docker
|
||||||
nixos.step-client
|
|
||||||
{
|
{
|
||||||
home-manager.users."${username}" = {
|
home-manager.users."${username}" = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
|
|||||||
@@ -9,7 +9,19 @@ in
|
|||||||
sops-nix.url = "github:Mic92/sops-nix";
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flake.modules.nixos.sops = {
|
||||||
|
imports = with inputs.sops-nix.nixosModules; [
|
||||||
|
sops
|
||||||
|
];
|
||||||
|
|
||||||
|
sops.defaultSopsFile = ../../keys/secrets.yaml;
|
||||||
|
sops.secrets."test-nix/ssh_host_key" = {
|
||||||
|
owner = "john";
|
||||||
|
path = "/home/john/.ssh/host_key";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Define the homeModules that are used by flake-parts
|
# Define the homeModules that are used by flake-parts
|
||||||
# https://flake.parts/options/home-manager.html#opt-flake.modules.homeManager
|
# https://flake.parts/options/home-manager.html#opt-flake.modules.homeManager
|
||||||
flake.modules.homeManager.sops = { inputs, config, pkgs, lib, ... }:
|
flake.modules.homeManager.sops = { inputs, config, pkgs, lib, ... }:
|
||||||
|
|||||||
Reference in New Issue
Block a user