mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
hp: move persistence
This commit is contained in:
parent
f658ef1d1a
commit
4cf06fce35
2 changed files with 22 additions and 23 deletions
|
@ -1,23 +1,5 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
services = {
|
|
||||||
openssh.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.mutableUsers = false;
|
|
||||||
users.users.root.passwordFile = "/nix/persist/shadow_sean";
|
|
||||||
users.users.sean.passwordFile = "/nix/persist/shadow_sean";
|
|
||||||
|
|
||||||
environment.etc =
|
|
||||||
lib.genAttrs
|
|
||||||
[
|
|
||||||
"machine-id"
|
|
||||||
"NetworkManager/system-connections"
|
|
||||||
"ssh/ssh_host_ed25519_key"
|
|
||||||
"ssh/ssh_host_rsa_key"
|
|
||||||
]
|
|
||||||
(name: { source = "/nix/persist/etc/${name}"; });
|
|
||||||
|
|
||||||
sconfig = {
|
sconfig = {
|
||||||
gnome = true;
|
gnome = true;
|
||||||
profile = "desktop";
|
profile = "desktop";
|
||||||
|
@ -25,6 +7,22 @@
|
||||||
wg-home.enable = true;
|
wg-home.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.etc.machine-id.source = "/var/lib/nixos/machine-id";
|
||||||
|
|
||||||
|
environment.etc."NetworkManager/system-connections".source =
|
||||||
|
"/var/lib/nixos/nm-connections";
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
hostKeys = [
|
||||||
|
{ type = "ed25519"; path = "/var/lib/nixos/ssh_host_ed25519_key"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.mutableUsers = false;
|
||||||
|
users.users.sean.passwordFile = "/var/lib/nixos/shadow_sean";
|
||||||
|
users.users.root.passwordFile = "/var/lib/nixos/shadow_sean";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
loader.efi.canTouchEfiVariables = false;
|
loader.efi.canTouchEfiVariables = false;
|
||||||
|
@ -35,10 +33,11 @@
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = { device = "tmpfs"; fsType = "tmpfs"; options = [ "mode=755" ]; };
|
"/" = { device = "tmpfs"; fsType = "tmpfs"; options = [ "mode=755" ]; };
|
||||||
"/nix" = { device = "zroot/locker/nix"; fsType = "zfs"; };
|
|
||||||
"/home" = { device = "zroot/locker/home"; fsType = "zfs"; };
|
|
||||||
"/boot" = { device = "/dev/disk/by-partlabel/EFI\\x20system\\x20partition"; fsType = "vfat"; };
|
"/boot" = { device = "/dev/disk/by-partlabel/EFI\\x20system\\x20partition"; fsType = "vfat"; };
|
||||||
"/var/log" = { device = "/nix/persist/var/log"; noCheck = true; options = [ "bind" ]; };
|
"/home" = { device = "zroot/locker/home"; fsType = "zfs"; };
|
||||||
|
"/nix" = { device = "zroot/locker/nix"; fsType = "zfs"; };
|
||||||
|
"/var/lib" = { device = "zroot/locker/lib"; fsType = "zfs"; };
|
||||||
|
"/var/log" = { device = "zroot/locker/log"; fsType = "zfs"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "21.05";
|
system.stateVersion = "21.05";
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
config = lib.mkIf config.sconfig.wg-home.enable {
|
config = lib.mkIf config.sconfig.wg-home.enable {
|
||||||
systemd.services.wg-home = {
|
systemd.services.wg-home = {
|
||||||
script = "wg-quick up /nix/persist/wireguard_home.conf";
|
script = "wg-quick up /var/lib/nixos/wireguard_home.conf";
|
||||||
preStop = "wg-quick down /nix/persist/wireguard_home.conf";
|
preStop = "wg-quick down /var/lib/nixos/wireguard_home.conf";
|
||||||
path = [ pkgs.wireguard-tools ];
|
path = [ pkgs.wireguard-tools ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
type = "oneshot";
|
type = "oneshot";
|
||||||
|
|
Loading…
Reference in a new issue