diff --git a/flake.lock b/flake.lock index 985957d..12220c6 100644 --- a/flake.lock +++ b/flake.lock @@ -91,11 +91,11 @@ ] }, "locked": { - "lastModified": 1706981411, - "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", + "lastModified": 1710888565, + "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "owner": "nix-community", "repo": "home-manager", - "rev": "652fda4ca6dafeb090943422c34ae9145787af37", + "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "type": "github" }, "original": { @@ -113,11 +113,11 @@ ] }, "locked": { - "lastModified": 1710687711, - "narHash": "sha256-s9pXc9Z4gzXNcY0WrL19UKzKe+iWVVN7Nnx26UU10dE=", + "lastModified": 1710946911, + "narHash": "sha256-qV20Q7Ejpec200oBwUAgVYQjKt5BLPMLCm5EaRX3qgQ=", "owner": "doronbehar", "repo": "nix-matlab", - "rev": "1a8e99ef27ed471e05b724a595d7a5f79f5a9926", + "rev": "034a198d09ed872331c910c6acdca1577ff30ba7", "type": "gitlab" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "lastModified": 1710951922, + "narHash": "sha256-FOOBJ3DQenLpTNdxMHR2CpGZmYuctb92gF0lpiirZ30=", "owner": "nixos", "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "rev": "f091af045dff8347d66d186a62d42aceff159456", "type": "github" }, "original": { @@ -144,11 +144,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1710631334, - "narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=", + "lastModified": 1710806803, + "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a", + "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3", "type": "github" }, "original": { diff --git a/systems/x86_64-linux/nix-builder/default.nix b/systems/x86_64-linux/nix-builder/default.nix new file mode 100644 index 0000000..964fac4 --- /dev/null +++ b/systems/x86_64-linux/nix-builder/default.nix @@ -0,0 +1,111 @@ +# sudo nixos-rebuild switch --flake .#nix-builder --target-host root@192.168.3.118 + +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + networking.hostName = "nix-builder"; # Define your hostname. + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver = { + layout = "de"; + xkbVariant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.nix = { + isNormalUser = true; + description = "Nix"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ ]; + }; + + nix.settings.trusted-users = [ "@wheel" ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Setup binary caches + nix.settings = { + substituters = + [ "https://nix-community.cachix.org" "https://cache.nixos.org/" ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + + # optimize store by hardlinking store files + nix.optimise.automatic = true; + nix.optimise.dates = [ "03:15" ]; + + nix.gc.automatic = true; + nix.gc.dates = "weekly"; + nix.gc.options = "--delete-older-than 30d"; + + # Garbage collect up to 30 GiB when only 5 GiB storage left + nix.extraOptions = '' + min-free = ${toString (5 * 1024 * 1024 * 1024)} + max-free = ${toString (30 * 1024 * 1024 * 1024)} + min-free-check-interval = 60 + ''; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ vim htop mc ]; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + security.pam.enableSSHAgentAuth = true; # enable sudo logins via ssh + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # 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 = "23.11"; # Did you read the comment? + +} diff --git a/systems/x86_64-linux/nix-builder/hardware-configuration.nix b/systems/x86_64-linux/nix-builder/hardware-configuration.nix new file mode 100644 index 0000000..c915166 --- /dev/null +++ b/systems/x86_64-linux/nix-builder/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/f088fe8e-bf3d-4a89-98bd-ead9852d381f"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/ab60b5f0-caaa-4a7e-803f-c4c1a6a076dd"; } + ]; + + # 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"; +}