+27
flake.nix
+27
flake.nix
···
39
39
}@inputs:
40
40
{
41
41
nixosConfigurations = {
42
+
pardinus =
43
+
let
44
+
username = "freyja";
45
+
specialArgs = { inherit username; };
46
+
hostname = "pardinus";
47
+
in
48
+
nixpkgs.lib.nixosSystem {
49
+
system = "x86_64-linux";
50
+
specialArgs = {
51
+
inherit inputs;
52
+
};
53
+
modules = [
54
+
disko.nixosModules.disko
55
+
./hosts/${hostname}
56
+
./modules/server.nix
57
+
home-manager.nixosModules.home-manager
58
+
{
59
+
home-manager.useGlobalPkgs = true;
60
+
home-manager.useUserPackages = true;
61
+
home-manager.extraSpecialArgs = inputs // specialArgs;
62
+
home-manager.users.${username} = ./home/server.nix;
63
+
nixpkgs = {
64
+
config.allowUnfree = true;
65
+
};
66
+
}
67
+
];
68
+
};
42
69
bobcat =
43
70
let
44
71
username = "freyja";
+1
home/default.nix
+1
home/default.nix
+13
home/desktop.nix
+13
home/desktop.nix
-7
home/gen.nix
-7
home/gen.nix
+9
home/server.nix
+9
home/server.nix
+42
hosts/pardinus/default.nix
+42
hosts/pardinus/default.nix
···
1
+
{
2
+
pkgs,
3
+
lib,
4
+
...
5
+
}@args:
6
+
{
7
+
imports = [
8
+
./disko.nix
9
+
./hardware-configuration.nix
10
+
];
11
+
12
+
myDisko.installDrive = "/dev/disk/by-id/nvme-SAMSUNG_MZVLB256HAHQ-000L2_S41FNB1K451436";
13
+
myDisko.dataDrive = "/dev/disk/by-id/ata-TEAM_T253A3001T_TPBF2007090080600447";
14
+
15
+
networking = {
16
+
hostName = "pardinus";
17
+
networkmanager.enable = true;
18
+
};
19
+
20
+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
21
+
22
+
zramSwap.enable = true;
23
+
24
+
users.users.root.hashedPassword = "$6$rounds=4096$96V6gRPM96ADrBZr$2BOE2hC7Kx3XF3z32HNYp7zjsiAcJ2BynpGlWqdPupY3Mxfcy1aDlxdyx6HixriYuuhiTV4XSgObBASKZjNmF/";
25
+
26
+
users.users = {
27
+
"freyja" = {
28
+
isNormalUser = true;
29
+
extraGroups = [
30
+
"wheel"
31
+
"tss"
32
+
];
33
+
hashedPassword = "$6$rounds=4096$048E1JljebjSdlsY$rDwVNrrNj.bG6JPKoe/K3PxPj3P5K3xnlvICk5gEhwGxFMYoH/APNlKDbNHHc/cPP1KbtDd2oYxqWwVxYDAAE1";
34
+
shell = pkgs.nushell;
35
+
36
+
openssh.authorizedKeys.keys = [
37
+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5TzxbVDkym7B4cPOk+zk7SUWfiQT8oxFL/K5q6TB+q freyja@bobcat"
38
+
]
39
+
++ (args.extraPublicKeys or [ ]);
40
+
};
41
+
};
42
+
}
+142
hosts/pardinus/disko.nix
+142
hosts/pardinus/disko.nix
···
1
+
{
2
+
config,
3
+
lib,
4
+
...
5
+
}:
6
+
{
7
+
options.myDisko.installDrive = lib.mkOption {
8
+
description = "Disk to install NixOS to.";
9
+
default = "/dev/nvme0n1";
10
+
type = lib.types.str;
11
+
};
12
+
13
+
options.myDisko.dataDrive = lib.mkOption {
14
+
description = "Additional data drive";
15
+
default = "/dev/sda";
16
+
type = lib.types.str;
17
+
};
18
+
19
+
config = {
20
+
assertions = [
21
+
{
22
+
assertion = config.myDisko.installDrive != "";
23
+
message = "config.myDisko.installDrive cannot be empty.";
24
+
}
25
+
{
26
+
assertion = config.myDisko.dataDrive != "";
27
+
message = "config.myDisko.dataDrive cannot be empty.";
28
+
}
29
+
];
30
+
31
+
disko.devices = {
32
+
disk = {
33
+
disk1 = {
34
+
type = "disk";
35
+
device = config.myDisko.installDrive;
36
+
37
+
content = {
38
+
type = "gpt";
39
+
40
+
partitions = {
41
+
ESP = {
42
+
content = {
43
+
format = "vfat";
44
+
45
+
mountOptions = [
46
+
"defaults"
47
+
"umask=0077"
48
+
];
49
+
50
+
mountpoint = "/boot";
51
+
type = "filesystem";
52
+
};
53
+
54
+
size = "1024M";
55
+
type = "EF00";
56
+
};
57
+
58
+
root = {
59
+
size = "100%";
60
+
content = {
61
+
type = "btrfs";
62
+
extraArgs = [ "-f" ];
63
+
64
+
subvolumes = {
65
+
"/home" = {
66
+
mountpoint = "/home";
67
+
mountOptions = [
68
+
"compress=zstd"
69
+
"noatime"
70
+
];
71
+
};
72
+
73
+
"/home/.snapshots" = {
74
+
mountOptions = [
75
+
"compress=zstd"
76
+
"noatime"
77
+
];
78
+
mountpoint = "/home/.snapshots";
79
+
};
80
+
81
+
"/nix" = {
82
+
mountpoint = "/nix";
83
+
mountOptions = [
84
+
"compress=zstd"
85
+
"noatime"
86
+
];
87
+
};
88
+
89
+
"persist" = {
90
+
mountpoint = "/persist";
91
+
mountOptions = [
92
+
"compress=zstd"
93
+
"noatime"
94
+
];
95
+
};
96
+
97
+
"/root" = {
98
+
mountpoint = "/";
99
+
mountOptions = [
100
+
"compress=zstd"
101
+
"noatime"
102
+
];
103
+
};
104
+
};
105
+
};
106
+
};
107
+
};
108
+
};
109
+
};
110
+
111
+
disk2 = {
112
+
type = "disk";
113
+
device = config.myDisko.dataDrive;
114
+
115
+
content = {
116
+
type = "gpt";
117
+
118
+
partitions = {
119
+
main = {
120
+
size = "100%";
121
+
content = {
122
+
type = "btrfs";
123
+
extraArgs = [ "-f" ];
124
+
125
+
subvolumes = {
126
+
"/srv" = {
127
+
mountpoint = "/srv";
128
+
mountOptions = [
129
+
"compress=zstd"
130
+
"noatime"
131
+
];
132
+
};
133
+
};
134
+
};
135
+
};
136
+
};
137
+
};
138
+
};
139
+
};
140
+
};
141
+
};
142
+
}
+32
hosts/pardinus/hardware-configuration.nix
+32
hosts/pardinus/hardware-configuration.nix
···
1
+
{
2
+
config,
3
+
lib,
4
+
pkgs,
5
+
...
6
+
}:
7
+
8
+
{
9
+
boot = {
10
+
initrd.availableKernelModules = [
11
+
"xhci_pci"
12
+
"ahci"
13
+
"ehci_pci"
14
+
"nvme"
15
+
"usb_storage"
16
+
"usbhid"
17
+
"sd_mod"
18
+
];
19
+
kernelModules = [ "kvm-amd" ];
20
+
loader = {
21
+
systemd-boot = {
22
+
enable = true;
23
+
configurationLimit = 10;
24
+
};
25
+
efi.canTouchEfiVariables = true;
26
+
};
27
+
kernelPackages = pkgs.linuxPackages_latest;
28
+
29
+
};
30
+
31
+
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
32
+
}
+53
modules/server.nix
+53
modules/server.nix
···
1
+
{
2
+
lib,
3
+
pkgs,
4
+
...
5
+
}:
6
+
{
7
+
imports = [
8
+
./services/tailscale.nix
9
+
./services/fwupd.nix
10
+
./services/kmscon.nix
11
+
];
12
+
13
+
system.stateVersion = "25.11";
14
+
15
+
time.timeZone = lib.mkDefault "America/Los_Angeles";
16
+
17
+
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
18
+
19
+
nixpkgs.config.allowUnfree = lib.mkDefault true;
20
+
21
+
environment.systemPackages = with pkgs; [
22
+
helix
23
+
zellij
24
+
git
25
+
pciutils
26
+
];
27
+
28
+
nix = {
29
+
gc = {
30
+
automatic = lib.mkDefault true;
31
+
dates = lib.mkDefault "weekly";
32
+
options = lib.mkDefault "--delete-older-than 1w";
33
+
};
34
+
35
+
settings = {
36
+
experimental-features = lib.mkDefault [
37
+
"nix-command"
38
+
"flakes"
39
+
];
40
+
auto-optimise-store = lib.mkDefault true;
41
+
};
42
+
};
43
+
44
+
services.openssh = {
45
+
enable = true;
46
+
settings = {
47
+
AllowUsers = [ "freyja" ];
48
+
PermitRootLogin = "no";
49
+
PasswordAuthentication = false;
50
+
};
51
+
};
52
+
networking.firewall.allowedTCPPorts = [ 22 ];
53
+
}