optimize etc persistence

This commit is contained in:
Sean Buckley 2022-03-07 11:10:35 -05:00
parent dd8faf730d
commit e0bc47520c
5 changed files with 18 additions and 18 deletions

View file

@ -12,9 +12,9 @@
nixos-hardware.nixosModules //
import lib/hardware.nix "${nixpkgs}/nixos/modules";
forAllSystems = f: builtins.listToAttrs (map
(name: { inherit name; value = f name; })
[ "x86_64-linux" "aarch64-linux" ]);
forAllSystems = f: nixpkgs.lib.genAttrs
[ "x86_64-linux" "aarch64-linux" ]
(system: f system);
pins = {
nix.registry.nixpkgs.to = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
networking.hostName = "cube";
@ -12,13 +12,13 @@
};
environment.etc =
builtins.listToAttrs (map
(name: { inherit name; value.source = "/nix/persist/etc/${name}"; })
lib.genAttrs
[
"machine-id"
"ssh/ssh_host_ed25519_key"
"ssh/ssh_host_rsa_key"
]);
]
(name: { source = "/nix/persist/etc/${name}"; });
services.openssh.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
networking.hostName = "hp";
@ -11,14 +11,14 @@
users.users.sean.passwordFile = "/nix/persist/shadow_sean";
environment.etc =
builtins.listToAttrs (map
(name: { inherit name; value.source = "/nix/persist/etc/${name}"; })
lib.genAttrs
[
"machine-id"
"NetworkManager/system-connections"
"ssh/ssh_host_ed25519_key"
"ssh/ssh_host_rsa_key"
]);
]
(name: { source = "/nix/persist/etc/${name}"; });
sconfig = {
gnome = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
networking.hostName = "lenny";
@ -11,14 +11,14 @@
users.users.sean.passwordFile = "/nix/persist/shadow_sean";
environment.etc =
builtins.listToAttrs (map
(name: { inherit name; value.source = "/nix/persist/etc/${name}"; })
lib.genAttrs
[
"machine-id"
"NetworkManager/system-connections"
"ssh/ssh_host_ed25519_key"
"ssh/ssh_host_rsa_key"
]);
]
(name: { source = "/nix/persist/etc/${name}"; });
sconfig = {
gnome = true;

View file

@ -14,13 +14,13 @@
users.users.sean.passwordFile = "/nix/persist/shadow_sean";
environment.etc =
builtins.listToAttrs (map
(name: { inherit name; value.source = "/nix/persist/etc/${name}"; })
lib.genAttrs
[
"machine-id"
"ssh/ssh_host_ed25519_key"
"ssh/ssh_host_rsa_key"
]);
]
(name: { source = "/nix/persist/etc/${name}"; });
boot = {
loader.systemd-boot.enable = true;