basic pi stuff, ugly but functional
This commit is contained in:
@@ -1,18 +1,44 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.mjallen.sops;
|
||||
in
|
||||
{
|
||||
# sops = {
|
||||
# age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
# defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
||||
# validateSopsFiles = false;
|
||||
# secrets = {
|
||||
# "ssh-keys-public/desktop-nixos" = {
|
||||
# path = "/home/matt/.ssh/id_ed25519.pub";
|
||||
# mode = "0644";
|
||||
# };
|
||||
# "ssh-keys-private/desktop-nixos" = {
|
||||
# path = "/home/matt/.ssh/id_ed25519";
|
||||
# mode = "0600";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops = {
|
||||
age.keyFile = "/home/admin/.config/sops/age/keys.txt";
|
||||
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
||||
validateSopsFiles = false;
|
||||
secrets = {
|
||||
"ssh-keys-public/jallen-nas" = {
|
||||
path = "/home/admin/.ssh/id_ed25519.pub";
|
||||
mode = "0644";
|
||||
};
|
||||
"ssh-keys-private/jallen-nas" = {
|
||||
path = "/home/admin/.ssh/id_ed25519";
|
||||
mode = "0600";
|
||||
};
|
||||
"ssh-keys-public/desktop-nixos" = {
|
||||
path = "/home/admin/.ssh/authorized_keys";
|
||||
mode = "0600";
|
||||
};
|
||||
|
||||
"ssh-keys-public/desktop-nixos-root" = {
|
||||
path = "/home/admin/.ssh/authorized_keys2";
|
||||
mode = "0600";
|
||||
};
|
||||
|
||||
"ssh-keys-public/desktop-windows" = {
|
||||
path = "/home/admin/.ssh/authorized_keys3";
|
||||
mode = "0600";
|
||||
};
|
||||
|
||||
"ssh-keys-public/macbook-macos" = {
|
||||
path = "/home/admin/.ssh/authorized_keys4";
|
||||
mode = "0600";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
modules/home/sops/options.nix
Normal file
12
modules/home/sops/options.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.mjallen.sops = {
|
||||
enable = mkEnableOption "enable sops";
|
||||
|
||||
defaultSopsFile = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
62
modules/nixos/home/default.nix
Normal file
62
modules/nixos/home/default.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
namespace,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.${namespace}.home = with lib.types; {
|
||||
configFile = lib.mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
|
||||
};
|
||||
extraOptions = lib.mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Options to pass directly to home-manager.";
|
||||
};
|
||||
file = lib.mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "A set of files to be managed by home-manager's <option>home.file</option>.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# ${namespace}.home.extraOptions = {
|
||||
# home.file = lib.mkAliasDefinitions options.${namespace}.home.file;
|
||||
# home.stateVersion = lib.mkOptionDefault config.system.stateVersion;
|
||||
# xdg.configFile = lib.mkAliasDefinitions options.${namespace}.home.configFile;
|
||||
# xdg.enable = lib.mkOptionDefault true;
|
||||
# };
|
||||
|
||||
home-manager = {
|
||||
# enables backing up existing files instead of erroring if conflicts exist
|
||||
backupFileExtension = "backup";
|
||||
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
# Pass inputs so external modules can access them
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
|
||||
# Make ALL external HM modules available globally
|
||||
sharedModules = with inputs; [
|
||||
sops-nix.homeManagerModules.sops
|
||||
steam-rom-manager.homeManagerModules.default
|
||||
# Add any other external HM modules here
|
||||
];
|
||||
|
||||
# users.${config.${namespace}.user.name} = lib.types.mkAliasDefinitions options.${namespace}.home.extraOptions;
|
||||
users.admin = lib.mkAliasDefinitions options.${namespace}.home.extraOptions;
|
||||
|
||||
verbose = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user