diff options
-rw-r--r-- | installer.nix | 34 | ||||
-rw-r--r-- | odin.nix | 55 | ||||
-rw-r--r-- | odin/hw.nix | 76 |
3 files changed, 165 insertions, 0 deletions
diff --git a/installer.nix b/installer.nix new file mode 100644 index 00000000..3bdca7ab --- /dev/null +++ b/installer.nix | |||
@@ -0,0 +1,34 @@ | |||
1 | { config, pkgs, lib, ... }: | ||
2 | |||
3 | { | ||
4 | imports = [ | ||
5 | <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> | ||
6 | <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> | ||
7 | ]; | ||
8 | |||
9 | boot.kernelPackages = pkgs.linuxPackages_latest; | ||
10 | |||
11 | systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ]; | ||
12 | |||
13 | environment.systemPackages = with pkgs; [ | ||
14 | mosh | ||
15 | tmux | ||
16 | zsh | ||
17 | pythonPackages.magic-wormhole | ||
18 | ]; | ||
19 | |||
20 | networking = { | ||
21 | hostName = ""; | ||
22 | |||
23 | firewall = { | ||
24 | enable = true; | ||
25 | allowPing = true; | ||
26 | allowedTCPPorts = [ 22 # ssh | ||
27 | ]; | ||
28 | allowedUDPPortRanges = [ { from = 60000; to = 61000; } # mosh | ||
29 | ]; | ||
30 | }; | ||
31 | }; | ||
32 | |||
33 | i18n.consoleKeyMap = "dvp"; | ||
34 | } | ||
diff --git a/odin.nix b/odin.nix new file mode 100644 index 00000000..21054dbc --- /dev/null +++ b/odin.nix | |||
@@ -0,0 +1,55 @@ | |||
1 | # Edit this configuration file to define what should be installed on | ||
2 | # your system. Help is available in the configuration.nix(5) man page | ||
3 | # and in the NixOS manual (accessible by running ‘nixos-help’). | ||
4 | |||
5 | { config, pkgs, ... }: | ||
6 | |||
7 | { | ||
8 | imports = | ||
9 | [ # Include the results of the hardware scan. | ||
10 | ./odin/hw.nix | ||
11 | ]; | ||
12 | |||
13 | # Use the GRUB 2 boot loader. | ||
14 | boot.loader.grub.enable = true; | ||
15 | boot.loader.grub.version = 2; | ||
16 | # Define on which hard drive you want to install Grub. | ||
17 | boot.loader.grub.device = "/dev/disk/by-id/ata-MKNSSDCR60GB_MK130619AS1031770"; | ||
18 | |||
19 | networking.hostName = "odin"; # Define your hostname. | ||
20 | |||
21 | # Select internationalisation properties. | ||
22 | i18n = { | ||
23 | consoleKeyMap = "dvp"; | ||
24 | defaultLocale = "en_US.UTF-8"; | ||
25 | }; | ||
26 | |||
27 | # Set your time zone. | ||
28 | time.timeZone = "Europe/Berlin"; | ||
29 | |||
30 | environment.systemPackages = with pkgs; [ | ||
31 | pythonPackages.magic-wormhole | ||
32 | tmux | ||
33 | mosh | ||
34 | ]; | ||
35 | |||
36 | programs.zsh.enable = true; | ||
37 | |||
38 | services.openssh.enable = true; | ||
39 | |||
40 | networking.firewall = { | ||
41 | enable = true; | ||
42 | allowPing = true; | ||
43 | allowedTCPPorts = [ 22 # ssh | ||
44 | ]; | ||
45 | allowedUDPPortRanges = [ { from = 60000; to = 61000; } # mosh | ||
46 | ]; | ||
47 | }; | ||
48 | |||
49 | # This value determines the NixOS release with which your system is to be | ||
50 | # compatible, in order to avoid breaking some software such as database | ||
51 | # servers. You should change this only after NixOS release notes say you | ||
52 | # should. | ||
53 | system.stateVersion = "18.09"; # Did you read the comment? | ||
54 | |||
55 | } | ||
diff --git a/odin/hw.nix b/odin/hw.nix new file mode 100644 index 00000000..07518dbc --- /dev/null +++ b/odin/hw.nix | |||
@@ -0,0 +1,76 @@ | |||
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ | ||
2 | # and may be overwritten by future invocations. Please make changes | ||
3 | # to /etc/nixos/configuration.nix instead. | ||
4 | { config, lib, pkgs, ... }: | ||
5 | |||
6 | { | ||
7 | imports = | ||
8 | [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> | ||
9 | ]; | ||
10 | |||
11 | boot.initrd = { | ||
12 | availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "xhci_pci" "ahci" "pata_marvell" "nvme" "firewire_ohci" "usb_storage" "usbhid" "sd_mod" ]; | ||
13 | luks.devices = { | ||
14 | raid6 = { | ||
15 | device = "/dev/disk/by-uuid/1a552384-4f74-40bf-a5cf-961ea24c339e"; | ||
16 | }; | ||
17 | ssd-raid1 = { | ||
18 | device = "/dev/disk/by-uuid/f348a104-4774-47b3-a241-b7eaca0080e3"; | ||
19 | }; | ||
20 | ssd-nvme = { | ||
21 | device = "/dev/disk/by-uuid/fdd3f054-edee-42d5-aa82-08e3477014f3"; | ||
22 | allowDiscards = true; | ||
23 | }; | ||
24 | }; | ||
25 | |||
26 | mdadmConf = '' | ||
27 | ARRAY /dev/md/isaac:raid6 metadata=1.2 name=isaac:raid6 UUID=42f7a827:e1c05dfe:7e7977dc:ccf1a569 | ||
28 | ARRAY /dev/md1 metadata=1.2 name=localhost:ssd-raid1 UUID=f2e398f9:e2d4d8ce:b1811e05:584bf759 | ||
29 | ARRAY /dev/md0 metadata=1.2 name=localhost:boot UUID=a56bdcef:a622dd3a:c6af3832:591a8bb3 | ||
30 | ''; | ||
31 | }; | ||
32 | |||
33 | boot.kernelModules = [ "kvm-intel" ]; | ||
34 | boot.extraModulePackages = [ ]; | ||
35 | |||
36 | fileSystems."/" = | ||
37 | { device = "/dev/disk/by-uuid/8dea04a6-4485-4cd2-bab5-d23321a11df9"; | ||
38 | fsType = "ext4"; | ||
39 | }; | ||
40 | |||
41 | fileSystems."/boot" = | ||
42 | { device = "/dev/disk/by-uuid/f6b49ce4-536c-4470-ad22-2af5c2b53d61"; | ||
43 | fsType = "ext4"; | ||
44 | }; | ||
45 | |||
46 | fileSystems."/srv/hlidskjalf" = | ||
47 | { device = "/dev/disk/by-uuid/e796f44c-2b0b-40a8-af22-90beb898d25e"; | ||
48 | fsType = "ext4"; | ||
49 | }; | ||
50 | |||
51 | fileSystems."/home" = | ||
52 | { device = "/dev/disk/by-uuid/e4737a9e-2a25-4247-936d-c0c4bad82970"; | ||
53 | fsType = "ext4"; | ||
54 | }; | ||
55 | |||
56 | fileSystems."/srv/media" = | ||
57 | { device = "/dev/disk/by-uuid/09959dcd-e8ca-4958-89b2-993cc79fe8f7"; | ||
58 | fsType = "ext4"; | ||
59 | }; | ||
60 | |||
61 | fileSystems."/srv/mail" = | ||
62 | { device = "/dev/disk/by-uuid/d43c25b5-2c0f-4ac9-9f0b-de93c33442a1"; | ||
63 | fsType = "ext4"; | ||
64 | }; | ||
65 | |||
66 | fileSystems."/nix/store" = | ||
67 | { device = "/dev/disk/by-uuid/b36a581c-e38c-4c25-9073-18a313cce286"; | ||
68 | fsType = "xfs"; | ||
69 | }; | ||
70 | |||
71 | swapDevices = | ||
72 | [ { device = "/dev/disk/by-uuid/a27e368d-e1ed-41e5-8bcb-6e5865670532"; } | ||
73 | ]; | ||
74 | |||
75 | nix.maxJobs = lib.mkDefault 8; | ||
76 | } | ||