From cf647cbaaa661f4a6b2bfd0356974ed8b0e06602 Mon Sep 17 00:00:00 2001 From: Daniel Meiburg Date: Wed, 24 Apr 2024 22:42:37 +0200 Subject: [PATCH] Add pinix --- flake.lock | 6 ++--- flake.nix | 20 ++++++++++++++ hosts/dmeiburg/configuration.nix | 3 +++ hosts/home-workstations.nix | 2 ++ hosts/p14s/configuration.nix | 4 +++ hosts/pinix/configuration.nix | 36 ++++++++++++++++++++++++++ hosts/pinix/hardware-configuration.nix | 32 +++++++++++++++++++++++ 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 hosts/pinix/configuration.nix create mode 100644 hosts/pinix/hardware-configuration.nix diff --git a/flake.lock b/flake.lock index 68e5342..819cafa 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713013257, - "narHash": "sha256-ZEfGB3YCBVggvk0BQIqVY7J8XF/9jxQ68fCca6nib+8=", + "lastModified": 1713828541, + "narHash": "sha256-KtvQeE12MSkCOhvVmnmcZCjnx7t31zWin2XVSDOwBDE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "90055d5e616bd943795d38808c94dbf0dd35abe8", + "rev": "b500489fd3cf653eafc075f9362423ad5cdd8676", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index db5f3f8..8886818 100644 --- a/flake.nix +++ b/flake.nix @@ -72,6 +72,26 @@ } ]; }; + + pinix = lib.nixosSystem { + system = "aarch64-linux"; + pkgs = import nixpkgs { + system = "aarch64-linux"; + config.allowUnfree = true; + }; + modules = [ + ./hosts/pinix/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.dm = { + imports = [ + ./hosts/home-common.nix + ]; + }; + } + ]; + }; }; }; } diff --git a/hosts/dmeiburg/configuration.nix b/hosts/dmeiburg/configuration.nix index d6d6c61..b3ca604 100644 --- a/hosts/dmeiburg/configuration.nix +++ b/hosts/dmeiburg/configuration.nix @@ -5,6 +5,9 @@ { config, pkgs, ... }: { + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix diff --git a/hosts/home-workstations.nix b/hosts/home-workstations.nix index 2dbaf71..9fca5fa 100644 --- a/hosts/home-workstations.nix +++ b/hosts/home-workstations.nix @@ -22,6 +22,7 @@ megatools mpv networkmanagerapplet + nodejs # copilot requirement obsidian openconnect owncloud-client @@ -31,6 +32,7 @@ polkit_gnome pulseaudio pynitrokey + rpi-imager sshfs swaybg thunderbird diff --git a/hosts/p14s/configuration.nix b/hosts/p14s/configuration.nix index 3ff0b57..212fe88 100644 --- a/hosts/p14s/configuration.nix +++ b/hosts/p14s/configuration.nix @@ -1,6 +1,10 @@ { config, pkgs, ... }: { + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix diff --git a/hosts/pinix/configuration.nix b/hosts/pinix/configuration.nix new file mode 100644 index 0000000..a466d31 --- /dev/null +++ b/hosts/pinix/configuration.nix @@ -0,0 +1,36 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + + ../common.nix + ./hardware-configuration.nix + ]; + +hardware = { + raspberry-pi."4".apply-overlays-dtmerge.enable = true; + deviceTree = { + enable = true; + filter = "*rpi-4-*.dtb"; + }; + }; + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + + # networking.hostName = "pinix"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # time.timeZone = "Europe/Berlin"; + + system.stateVersion = "24.05"; # Did you read the comment? + +} + diff --git a/hosts/pinix/hardware-configuration.nix b/hosts/pinix/hardware-configuration.nix new file mode 100644 index 0000000..e3913be --- /dev/null +++ b/hosts/pinix/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.end0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}