From dedf54a15b1216635d20192d5e9561bd1a05cea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Tveit?= Date: Sat, 6 Jul 2024 13:06:34 +0200 Subject: [PATCH] hosts/dagali: init --- base.nix | 6 ++-- flake.lock | 44 ++++++++++++------------- flake.nix | 1 + hosts/dagali/configuration.nix | 40 ++++++++++++++++++++++ hosts/dagali/hardware-configuration.nix | 33 +++++++++++++++++++ values.nix | 4 +++ 6 files changed, 103 insertions(+), 25 deletions(-) create mode 100644 hosts/dagali/configuration.nix create mode 100644 hosts/dagali/hardware-configuration.nix diff --git a/base.nix b/base.nix index 092cce2..841bbc8 100644 --- a/base.nix +++ b/base.nix @@ -48,9 +48,9 @@ ** use the same channel the system ** was built with */ - nix.registry = { - nixpkgs.flake = inputs.nixpkgs; - }; + # nix.registry = { + # nixpkgs.flake = inputs.nixpkgs; + # }; nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; environment.systemPackages = with pkgs; [ diff --git a/flake.lock b/flake.lock index c2fe550..42fba45 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1715445235, - "narHash": "sha256-SUu+oIWn+xqQIOlwfwNfS9Sek4i1HKsrLJchsDReXwA=", + "lastModified": 1720056646, + "narHash": "sha256-BymcV4HWtx2VFuabDCM4/nEJcfivCx0S02wUCz11mAY=", "owner": "nix-community", "repo": "disko", - "rev": "159d87ea5b95bbdea46f0288a33c5e1570272725", + "rev": "64679cd7f318c9b6595902b47d4585b1d51d5f9e", "type": "github" }, "original": { @@ -67,11 +67,11 @@ ] }, "locked": { - "lastModified": 1715364232, - "narHash": "sha256-ZJC3SkanEgbV7p+LFhP+85CviRWOXJNHzZwR/Stb7hE=", + "lastModified": 1716065905, + "narHash": "sha256-08uhxBzfakfhl/ooc+gMzDupWKYvTeyQZwuvB1SBS7A=", "owner": "Programvareverkstedet", "repo": "grzegorz", - "rev": "3841cda1cdcac470440b06838d56a2eb2256378c", + "rev": "0481aef6553ae9aee86e4edb4ca0ed4f2eba2058", "type": "github" }, "original": { @@ -87,11 +87,11 @@ ] }, "locked": { - "lastModified": 1715384651, - "narHash": "sha256-7RhckgUTjqeCjWkhiCc1iB+5CBx9fl80d/3O4Jh+5kM=", + "lastModified": 1716115695, + "narHash": "sha256-aI65l4x+U5v3i/nfn6N3eW5IZodmf4pyAByE7vTJh8I=", "owner": "Programvareverkstedet", "repo": "grzegorz-clients", - "rev": "738a4f3dd887f7c3612e4e772b83cbfa3cde5693", + "rev": "b9444658fbb39cd1bf1c61ee5a1d5f0641c49abe", "type": "github" }, "original": { @@ -143,11 +143,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719520878, - "narHash": "sha256-5BXzNOl2RVHcfS/oxaZDKOi7gVuTyWPibQG0DHd5sSc=", + "lastModified": 1720137366, + "narHash": "sha256-Xn+WAX2t2yjNdgZEyEtjCLvkqjrGPVhKRGsM6ujUf8c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a44bedbb48c367f0476e6a3a27bf28f6330faf23", + "rev": "f2a40608e6b55661cac28e473e28b6208da53c01", "type": "github" }, "original": { @@ -158,27 +158,27 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1714858427, - "narHash": "sha256-tCxeDP4C1pWe2rYY3IIhdA40Ujz32Ufd4tcrHPSKx2M=", + "lastModified": 1719720450, + "narHash": "sha256-57+R2Uj3wPeDeq8p8un19tzFFlgWiXJ8PbzgKtBgBX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b980b91038fc4b09067ef97bbe5ad07eecca1e76", + "rev": "78f8641796edff3bfabbf1ef5029deadfe4a21d0", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1715435713, - "narHash": "sha256-lb2HqDQGfTdnCCpc1pgF6fkdgIOuBQ0nP8jjVSfLFqg=", + "lastModified": 1720149507, + "narHash": "sha256-OFJoD1jjxzFlY1tAsehEWVA88DbU5smzDPQuu9SmnXY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52b40f6c4be12742b1504ca2eb4527e597bf2526", + "rev": "d9c0b9d611277e42e6db055636ba0409c59db6d2", "type": "github" }, "original": { @@ -249,11 +249,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1715244550, - "narHash": "sha256-ffOZL3eaZz5Y1nQ9muC36wBCWwS1hSRLhUzlA9hV2oI=", + "lastModified": 1720187017, + "narHash": "sha256-Zq+T1Bvd0ShZB9XM+bP0VJK3HjsSVQBLolkaCLBQnfQ=", "owner": "Mic92", "repo": "sops-nix", - "rev": "0dc50257c00ee3c65fef3a255f6564cfbfe6eb7f", + "rev": "1b11e208cee97c47677439625dc22e5289dcdead", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d545533..bb6095a 100644 --- a/flake.nix +++ b/flake.nix @@ -122,6 +122,7 @@ ]; }; buskerud = stableNixosConfig "buskerud" { }; + dagali = unstableNixosConfig "dagali" { }; }; devShells = forAllSystems (system: { diff --git a/hosts/dagali/configuration.nix b/hosts/dagali/configuration.nix new file mode 100644 index 0000000..499d3b6 --- /dev/null +++ b/hosts/dagali/configuration.nix @@ -0,0 +1,40 @@ + +{ config, pkgs, values, ... }: +{ + imports = [ + ./hardware-configuration.nix + ../../base.nix + ../../misc/metrics-exporters.nix + ]; + + # buskerud does not support efi? + # boot.loader.systemd-boot.enable = true; + # boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + networking.hostName = "dagali"; + networking.search = [ "pvv.ntnu.no" "pvv.org" ]; + networking.nameservers = [ "129.241.0.200" "129.241.0.201" ]; + networking.tempAddresses = "disabled"; + networking.networkmanager.enable = true; + + systemd.network.networks."ens18" = values.defaultNetworkConfig // { + matchConfig.Name = "ens18"; + address = with values.hosts.dagali; [ (ipv4 + "/25") (ipv6 + "/64") ]; + }; + + # List packages installed in system profile + environment.systemPackages = with pkgs; [ + # TODO: consider adding to base.nix + nix-output-monitor + ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/hosts/dagali/hardware-configuration.nix b/hosts/dagali/hardware-configuration.nix new file mode 100644 index 0000000..4bf4839 --- /dev/null +++ b/hosts/dagali/hardware-configuration.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4de345e2-be41-4d10-9b90-823b2c77e9b3"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/aa4b9a97-a7d8-4608-9f67-4ad084f1baf7"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/values.nix b/values.nix index 0c68b65..f469edd 100644 --- a/values.nix +++ b/values.nix @@ -29,6 +29,10 @@ in rec { ipv4 = pvv-ipv4 168; ipv6 = pvv-ipv6 168; }; + dagali = { + ipv4 = pvv-ipv4 185; + ipv6 = pvv-ipv6 185; + }; ildkule = { ipv4 = "10.212.25.209"; ipv6 = "2001:700:300:6025:f816:3eff:feee:812d";