Compare commits
3 Commits
9f5ba289ff
...
640cc88ae1
| Author | SHA1 | Date | |
|---|---|---|---|
| 640cc88ae1 | |||
| 457efb9bb6 | |||
| 20212556e5 |
@@ -13,18 +13,22 @@
|
|||||||
fileSystems."/data/media" = {
|
fileSystems."/data/media" = {
|
||||||
device = "//fractal/media";
|
device = "//fractal/media";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = let
|
options =
|
||||||
|
let
|
||||||
# this line prevents hanging on network split
|
# this line prevents hanging on network split
|
||||||
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
||||||
in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
|
in
|
||||||
|
[ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/data/shared" = {
|
fileSystems."/data/shared" = {
|
||||||
device = "//fractal/shared";
|
device = "//fractal/shared";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = let
|
options =
|
||||||
|
let
|
||||||
# this line prevents hanging on network split
|
# this line prevents hanging on network split
|
||||||
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
||||||
in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
|
in
|
||||||
|
[ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
servers = [ "c1" "c2" "c3" ];
|
servers = [
|
||||||
|
"c1"
|
||||||
|
"c2"
|
||||||
|
"c3"
|
||||||
|
];
|
||||||
server_enabled = builtins.elem config.networking.hostName servers;
|
server_enabled = builtins.elem config.networking.hostName servers;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -21,12 +25,20 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [ "/var/lib/consul" ];
|
||||||
"/var/lib/consul"
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [ 8600 8500 8301 8302 8300 ];
|
allowedTCPPorts = [
|
||||||
allowedUDPPorts = [ 8600 8301 8302 ];
|
8600
|
||||||
|
8500
|
||||||
|
8301
|
||||||
|
8302
|
||||||
|
8300
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
8600
|
||||||
|
8301
|
||||||
|
8302
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
{
|
{ virtualisation.docker.enable = true; }
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
{
|
{ powerManagement.cpuFreqGovernor = "ondemand"; }
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
{
|
{ time.timeZone = "Europe/Lisbon"; }
|
||||||
time.timeZone = "Europe/Lisbon";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist" = {
|
environment.persistence."/persist" = {
|
||||||
directories = [
|
directories = [ "/var/db/dhcpcd" ];
|
||||||
"/var/db/dhcpcd"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
nix.settings.trusted-users = [
|
||||||
|
"root"
|
||||||
|
"@wheel"
|
||||||
|
];
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
system.activationScripts.show-update-changelog = ''
|
system.activationScripts.show-update-changelog = ''
|
||||||
|
|||||||
@@ -8,7 +8,5 @@ in
|
|||||||
|
|
||||||
services.tailscale.package = pkgs.unstable.tailscale;
|
services.tailscale.package = pkgs.unstable.tailscale;
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [ "/var/lib/tailscale" ];
|
||||||
"/var/lib/tailscale"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
# https://guekka.github.io/nixos-server-2/
|
# https://guekka.github.io/nixos-server-2/
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
with lib; let
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.services.tailscaleAutoconnect;
|
cfg = config.services.tailscaleAutoconnect;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.tailscaleAutoconnect = {
|
options.services.tailscaleAutoconnect = {
|
||||||
enable = mkEnableOption "tailscaleAutoconnect";
|
enable = mkEnableOption "tailscaleAutoconnect";
|
||||||
|
|
||||||
@@ -56,8 +63,14 @@ in {
|
|||||||
description = "Automatic connection to Tailscale";
|
description = "Automatic connection to Tailscale";
|
||||||
|
|
||||||
# make sure tailscale is running before trying to connect to tailscale
|
# make sure tailscale is running before trying to connect to tailscale
|
||||||
after = ["network-pre.target" "tailscale.service"];
|
after = [
|
||||||
wants = ["network-pre.target" "tailscale.service"];
|
"network-pre.target"
|
||||||
|
"tailscale.service"
|
||||||
|
];
|
||||||
|
wants = [
|
||||||
|
"network-pre.target"
|
||||||
|
"tailscale.service"
|
||||||
|
];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
services.glusterfs = {
|
services.glusterfs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [ "/var/lib/glusterd" ];
|
||||||
"/var/lib/glusterd"
|
|
||||||
];
|
|
||||||
|
|
||||||
# TODO: each volume needs its own port starting at 49152
|
# TODO: each volume needs its own port starting at 49152
|
||||||
networking.firewall.allowedTCPPorts = [ 24007 24008 24009 49152 49153 49154 49155 ];
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
24007
|
||||||
|
24008
|
||||||
|
24009
|
||||||
|
49152
|
||||||
|
49153
|
||||||
|
49154
|
||||||
|
49155
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ inputs.impermanence.nixosModules.impermanence ];
|
||||||
inputs.impermanence.nixosModules.impermanence
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.persistence."/persist" = {
|
environment.persistence."/persist" = {
|
||||||
directories = [
|
directories = [ "/var/lib/nixos" ];
|
||||||
"/var/lib/nixos"
|
|
||||||
];
|
|
||||||
files = [
|
files = [
|
||||||
"/etc/machine-id"
|
"/etc/machine-id"
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
@@ -17,11 +13,23 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/".options = ["compress=zstd" "noatime" ];
|
fileSystems."/".options = [
|
||||||
fileSystems."/nix".options = ["compress=zstd" "noatime" ];
|
"compress=zstd"
|
||||||
fileSystems."/persist".options = ["compress=zstd" "noatime" ];
|
"noatime"
|
||||||
|
];
|
||||||
|
fileSystems."/nix".options = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
fileSystems."/persist".options = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
fileSystems."/persist".neededForBoot = true;
|
fileSystems."/persist".neededForBoot = true;
|
||||||
fileSystems."/var/log".options = ["compress=zstd" "noatime" ];
|
fileSystems."/var/log".options = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
fileSystems."/var/log".neededForBoot = true;
|
fileSystems."/var/log".neededForBoot = true;
|
||||||
|
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
@@ -58,4 +66,3 @@
|
|||||||
umount /mnt
|
umount /mnt
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
# inspiration: https://github.com/astro/skyflake/blob/main/nixos-modules/nomad.nix
|
# inspiration: https://github.com/astro/skyflake/blob/main/nixos-modules/nomad.nix
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
servers = [ "c1" "c2" "c3" ];
|
servers = [
|
||||||
|
"c1"
|
||||||
|
"c2"
|
||||||
|
"c3"
|
||||||
|
];
|
||||||
server_enabled = builtins.elem config.networking.hostName servers;
|
server_enabled = builtins.elem config.networking.hostName servers;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -83,7 +87,15 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = if server_enabled then [ 4646 4647 4648 ] else [ 4646 ];
|
allowedTCPPorts =
|
||||||
|
if server_enabled then
|
||||||
|
[
|
||||||
|
4646
|
||||||
|
4647
|
||||||
|
4648
|
||||||
|
]
|
||||||
|
else
|
||||||
|
[ 4646 ];
|
||||||
allowedUDPPorts = if server_enabled then [ 4648 ] else [ ];
|
allowedUDPPorts = if server_enabled then [ 4648 ] else [ ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,7 @@
|
|||||||
# This could list the owner user but I'm not sure if it's already created at
|
# This could list the owner user but I'm not sure if it's already created at
|
||||||
# the time impermanence setup runs.
|
# the time impermanence setup runs.
|
||||||
# Note: chown syncthing:syncthing /data/sync && chmod 700 /data/sync also seems to work
|
# Note: chown syncthing:syncthing /data/sync && chmod 700 /data/sync also seems to work
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [ "/data/sync" ];
|
||||||
"/data/sync"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -18,10 +16,18 @@
|
|||||||
overrideFolders = true;
|
overrideFolders = true;
|
||||||
settings = {
|
settings = {
|
||||||
devices = {
|
devices = {
|
||||||
"c1" = { id = "53JGRHQ-VGBYIGH-7IT6Z5S-3IMRY2I-LJZAE3B-QUDH3QF-4F4QKVC-VBWPJQ4"; };
|
"c1" = {
|
||||||
"c2" = { id = "Z3D476N-PUV6WAD-DSJWVBO-TWEOD4I-KDDMNRB-QEBOP6T-BYPGYTX-RAAYGAW"; };
|
id = "53JGRHQ-VGBYIGH-7IT6Z5S-3IMRY2I-LJZAE3B-QUDH3QF-4F4QKVC-VBWPJQ4";
|
||||||
"c3" = { id = "D3C3YII-A3QGUNF-LHOGZNX-GJ4ZF3X-VVLMNY5-BBKF3BO-KNHKJMD-EA5QYQJ"; };
|
};
|
||||||
"zippy" = { id = "WXDYZWN-JG2OBQH-CC42RMM-LPJGTS6-Y2BV37J-TYSLHL4-VHGYL5M-URI42QJ"; };
|
"c2" = {
|
||||||
|
id = "Z3D476N-PUV6WAD-DSJWVBO-TWEOD4I-KDDMNRB-QEBOP6T-BYPGYTX-RAAYGAW";
|
||||||
|
};
|
||||||
|
"c3" = {
|
||||||
|
id = "D3C3YII-A3QGUNF-LHOGZNX-GJ4ZF3X-VVLMNY5-BBKF3BO-KNHKJMD-EA5QYQJ";
|
||||||
|
};
|
||||||
|
"zippy" = {
|
||||||
|
id = "WXDYZWN-JG2OBQH-CC42RMM-LPJGTS6-Y2BV37J-TYSLHL4-VHGYL5M-URI42QJ";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
folders = {
|
folders = {
|
||||||
"wordpress" = {
|
"wordpress" = {
|
||||||
|
|||||||
45
flake.nix
45
flake.nix
@@ -20,23 +20,35 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, disko, ... }@inputs:
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
deploy-rs,
|
||||||
|
disko,
|
||||||
|
...
|
||||||
|
}@inputs:
|
||||||
let
|
let
|
||||||
inherit (self);
|
inherit (self);
|
||||||
|
|
||||||
overlay-unstable = final: prev: {
|
overlay-unstable = final: prev: { unstable = nixpkgs-unstable.legacyPackages.${prev.system}; };
|
||||||
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkNixos = system: modules: nixpkgs.lib.nixosSystem {
|
mkNixos =
|
||||||
|
system: modules:
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
system = system;
|
system = system;
|
||||||
modules = [
|
modules = [
|
||||||
({ config, pkgs, ... }: {
|
(
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
nixpkgs.overlays = [ overlay-unstable ];
|
nixpkgs.overlays = [ overlay-unstable ];
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
})
|
}
|
||||||
|
)
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
inputs.home-manager.nixosModules.home-manager {
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
@@ -49,15 +61,21 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
] ++ modules;
|
] ++ modules;
|
||||||
specialArgs = { inherit inputs self; };
|
specialArgs = {
|
||||||
|
inherit inputs self;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgsFor = system: import nixpkgs {
|
pkgsFor =
|
||||||
|
system:
|
||||||
|
import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ overlay-unstable ];
|
overlays = [ overlay-unstable ];
|
||||||
};
|
};
|
||||||
|
|
||||||
deployPkgsFor = system: import nixpkgs {
|
deployPkgsFor =
|
||||||
|
system:
|
||||||
|
import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
overlay-unstable
|
overlay-unstable
|
||||||
@@ -70,7 +88,8 @@
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
c1 = mkNixos "x86_64-linux" [ ./hosts/c1 ];
|
c1 = mkNixos "x86_64-linux" [ ./hosts/c1 ];
|
||||||
c2 = mkNixos "x86_64-linux" [ ./hosts/c2 ];
|
c2 = mkNixos "x86_64-linux" [ ./hosts/c2 ];
|
||||||
@@ -144,5 +163,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
||||||
|
|
||||||
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
packages = import ./packages.nix { inherit pkgs; };
|
packages = import ./packages.nix { inherit pkgs; };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home = {
|
home = {
|
||||||
inherit packages;
|
inherit packages;
|
||||||
stateVersion = "24.05"; # TODO: unify this with the references in flake.nix:inputs
|
stateVersion = "24.05"; # TODO: unify this with the references in flake.nix:inputs
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
VISUAL = "nvim";
|
||||||
MOSH_SERVER_NETWORK_TMOUT = 604800;
|
MOSH_SERVER_NETWORK_TMOUT = 604800;
|
||||||
NOMAD_ADDR = "http://nomad.service.consul:4646";
|
NOMAD_ADDR = "http://nomad.service.consul:4646";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ let
|
|||||||
vim
|
vim
|
||||||
zsh
|
zsh
|
||||||
];
|
];
|
||||||
in nixTools
|
in
|
||||||
|
nixTools
|
||||||
|
|||||||
@@ -1,47 +1,55 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"virtio_pci"
|
||||||
|
"virtio_scsi"
|
||||||
|
"usbhid"
|
||||||
|
"sr_mod"
|
||||||
|
];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=root" ];
|
options = [ "subvol=root" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" = {
|
||||||
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=nix" ];
|
options = [ "subvol=nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/persist" =
|
fileSystems."/persist" = {
|
||||||
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=persist" ];
|
options = [ "subvol=persist" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/var/log" =
|
fileSystems."/var/log" = {
|
||||||
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=log" ];
|
options = [ "subvol=log" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" = {
|
||||||
{ device = "/dev/disk/by-uuid/FF9C-DC81";
|
device = "/dev/disk/by-uuid/FF9C-DC81";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [ "umask=0077" ]; # to avoid the random seed being world readable
|
options = [ "umask=0077" ]; # to avoid the random seed being world readable
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ {
|
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
|
||||||
device = "/dev/disk/by-label/swap";
|
|
||||||
}];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.traefik ];
|
environment.systemPackages = [ pkgs.traefik ];
|
||||||
environment.persistence."/persist".files = [
|
environment.persistence."/persist".files = [ "/acme/acme.json" ];
|
||||||
"/acme/acme.json"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.traefik = {
|
services.traefik = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../../common/encrypted-btrfs-layout.nix
|
||||||
../../common/global
|
../../common/global
|
||||||
../../common/compute-node.nix
|
../../common/compute-node.nix
|
||||||
../../common/encrypted-btrfs-layout.nix
|
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../../common/encrypted-btrfs-layout.nix
|
||||||
../../common/global
|
../../common/global
|
||||||
../../common/compute-node.nix
|
../../common/compute-node.nix
|
||||||
../../common/encrypted-btrfs-layout.nix
|
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../../common/encrypted-btrfs-layout.nix
|
||||||
../../common/global
|
../../common/global
|
||||||
../../common/compute-node.nix
|
../../common/compute-node.nix
|
||||||
../../common/encrypted-btrfs-layout.nix
|
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"usbhid"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
{ lib, pkgs, inputs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../../common/encrypted-btrfs-layout.nix
|
||||||
../../common/global
|
../../common/global
|
||||||
../../common/base-node.nix
|
../../common/base-node.nix
|
||||||
../../common/encrypted-btrfs-layout.nix
|
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
@@ -13,4 +22,3 @@
|
|||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,32 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"ata_piix"
|
||||||
|
"uhci_hcd"
|
||||||
|
"virtio_pci"
|
||||||
|
"virtio_scsi"
|
||||||
|
"sd_mod"
|
||||||
|
"sr_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/d8fd0d0d-99f3-47c3-9821-1ecb51e0fa7b";
|
device = "/dev/disk/by-uuid/d8fd0d0d-99f3-47c3-9821-1ecb51e0fa7b";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [ { device = "/dev/disk/by-uuid/f50d64a5-948d-4ff4-88f2-0e0f4eae4c9e"; } ];
|
||||||
[ { device = "/dev/disk/by-uuid/f50d64a5-948d-4ff4-88f2-0e0f4eae4c9e"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../../common/encrypted-btrfs-layout.nix
|
||||||
../../common/global
|
../../common/global
|
||||||
../../common/compute-node.nix
|
../../common/compute-node.nix
|
||||||
../../common/dev-node.nix
|
../../common/dev-node.nix
|
||||||
../../common/encrypted-btrfs-layout.nix
|
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ehci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
@@ -13,4 +24,3 @@
|
|||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user