mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
refactor: simplify host setup
This commit is contained in:
parent
15fb616845
commit
d1d4082d56
27 changed files with 147 additions and 90 deletions
|
|
@ -2,6 +2,7 @@ _: {
|
|||
options.fireproof.base = {};
|
||||
|
||||
imports = [
|
||||
./fireproof.nix
|
||||
./defaults.nix
|
||||
./gc.nix
|
||||
./home-manager.nix
|
||||
|
|
|
|||
12
modules/base/fireproof.nix
Normal file
12
modules/base/fireproof.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{lib, ...}: {
|
||||
options.fireproof = {
|
||||
hostname = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The hostname of the machine";
|
||||
};
|
||||
username = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The primary username for the machine";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib; let
|
||||
inherit (config.fireproof) username;
|
||||
in {
|
||||
options.fireproof = {
|
||||
home-manager = lib.mkOption {
|
||||
type = options.home-manager.users.type.nestedTypes.elemType;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
{username, ...}: {
|
||||
{config, ...}: {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings = {
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
username
|
||||
config.fireproof.username
|
||||
];
|
||||
|
||||
experimental-features = "nix-command flakes";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{hostname, ...}: let
|
||||
{config, ...}: let
|
||||
inherit (config.fireproof) hostname;
|
||||
hostSecrets = ../../secrets/hosts + ("/" + hostname);
|
||||
publicKey = builtins.readFile (hostSecrets + "/id_ed25519.pub");
|
||||
in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue