diff --git a/README.md b/README.md index 3283272..7bff89f 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,5 @@ materusPC - my main PC flamaster - my laptop, used mostly as server for games. valkyrie - VPS, my website and pleroma instance + +waffentrager - raspberry pi4 \ No newline at end of file diff --git a/configurations/host/default.nix b/configurations/host/default.nix index a8ab430..314a696 100644 --- a/configurations/host/default.nix +++ b/configurations/host/default.nix @@ -31,4 +31,5 @@ in materusPC = makeSystem { host = "materusPC"; stable = false; }; flamaster = makeSystem { host = "flamaster"; stable = true; }; valkyrie = makeSystem { host = "valkyrie"; stable = true; }; + waffentrager = makeSystem { host = "waffentrager"; stable = false; arch = "aarch64-linux"; extraModules = [];}; } diff --git a/configurations/host/waffentrager/configuration.nix b/configurations/host/waffentrager/configuration.nix new file mode 100644 index 0000000..e926e16 --- /dev/null +++ b/configurations/host/waffentrager/configuration.nix @@ -0,0 +1,138 @@ +# 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 + ]; + environment.systemPackages = with pkgs; [ + libraspberrypi + raspberrypi-eeprom + git + ]; + sound.enable = false; + boot.tmp.useTmpfs = true; + services.xserver.enable = false; + networking.hostName = "waffentrager"; + services.openssh.enable = true; + users.users.materus = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPEDY+H8Hc/RSLE064AAh8IojvqxPd8BE5gec2aOfYMh materus@podkos.pl" + ]; + }; + + nix = { + settings = { + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" "repl-flake" "no-url-literals" ]; + trusted-users = [ "root" "@wheel" ]; + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + "https://nixerus.cachix.org/" + ]; + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixerus.cachix.org-1:2x7sIG7y1vAoxc8BNRJwsfapZsiX4hIl4aTi9V5ZDdE="]; + }; + }; + # 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 = "nixos"; # 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. + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkbOptions in tty. + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + + + # Configure keymap in X11 + # services.xserver.layout = "us"; + # services.xserver.xkbOptions = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.alice = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # firefox + # tree + # ]; + # }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # 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/configurations/host/waffentrager/default.nix b/configurations/host/waffentrager/default.nix new file mode 100644 index 0000000..e949ad7 --- /dev/null +++ b/configurations/host/waffentrager/default.nix @@ -0,0 +1,8 @@ +{ config, pkgs, materusCfg, ... }: +{ + + imports = [ + materusCfg.configInputs.inputs.nixos-hardware.nixosModules.raspberry-pi-4 + ./configuration.nix + ]; +} \ No newline at end of file diff --git a/configurations/host/waffentrager/extraHome.nix b/configurations/host/waffentrager/extraHome.nix new file mode 100644 index 0000000..8b32972 --- /dev/null +++ b/configurations/host/waffentrager/extraHome.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: +{ + home.stateVersion = "23.11"; + home.homeDirectory = "/home/materus"; + materus.profile = { + fonts.enable = false; + nixpkgs.enable = false; + enableDesktop = false; + enableTerminal = false; + enableTerminalExtra = false; + enableNixDevel = false; + + fish.enable = false; + bash.enable = true; + }; +} diff --git a/configurations/host/waffentrager/hardware-configuration.nix b/configurations/host/waffentrager/hardware-configuration.nix new file mode 100644 index 0000000..1a2d188 --- /dev/null +++ b/configurations/host/waffentrager/hardware-configuration.nix @@ -0,0 +1,44 @@ +# 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.kernelPackages = pkgs.linuxPackages_rpi4; + boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + boot.kernel.sysctl = { + "vm.swappiness" = 10; + }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + fileSystems."/etc/nixos" = + { + device = "/materus/config/nixos-config"; + fsType = "none"; + options = [ "bind" ]; + }; + + swapDevices = [{ + device = "/var/.swapfile"; + size = 8 * 1024; + }]; + + # 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 = "aarch64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/flake.lock b/flake.lock index e825584..0be2f56 100644 --- a/flake.lock +++ b/flake.lock @@ -5,17 +5,18 @@ "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", "nixerus": "nixerus", + "nixos-hardware": "nixos-hardware", "nixpkgs": [ "nixpkgs" ], "nur": "nur_2" }, "locked": { - "lastModified": 1696774666, - "narHash": "sha256-kqSXbAPQdkUadGsQL/bH9FBV/y4+d2g3GJxJHafquS4=", + "lastModified": 1698402907, + "narHash": "sha256-UlpPCLpyNEoQ7Enb0AhhIM8d7lC/2BWd8+fjNm9N/GY=", "owner": "materusPL", "repo": "nixos-config", - "rev": "cae14663b542afa8140c72b8aa42cd42cf7b0151", + "rev": "06a35210af4b8586a2b3d64815a67e3516ce732a", "type": "github" }, "original": { @@ -30,7 +31,7 @@ "emacs-overlay": "emacs-overlay_2", "home-manager": "home-manager_2", "nixerus": "nixerus_2", - "nixos-hardware": "nixos-hardware", + "nixos-hardware": "nixos-hardware_2", "nixpkgs": [ "nixpkgs-stable" ], @@ -61,11 +62,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698169740, - "narHash": "sha256-0p7oPZpQwE969gJ3XxNSN1KEKQQ/75Wt8+Vw8hHnTBA=", + "lastModified": 1698401973, + "narHash": "sha256-ITmrkooGUmat5f9T3yzKqoqu5eO8QfHq2JNOa0tPb1E=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "7fe9fac2a61c2e476bbb586f20ab4872072e2868", + "rev": "88a6b098a9e77718eebd801b650695765e54136a", "type": "github" }, "original": { @@ -143,11 +144,11 @@ ] }, "locked": { - "lastModified": 1698128422, - "narHash": "sha256-Qf39ATHrj6wfeC+K6uwD/FnI7RKrdEiN3uWaciUi0rM=", + "lastModified": 1698392685, + "narHash": "sha256-yx/sbRneR2AfSAeAMqUu0hoVJdjh+qhl/7dkirp8yo8=", "owner": "nix-community", "repo": "home-manager", - "rev": "6045b68ee725167ed0487f0fb88123202ba61923", + "rev": "1369d2cefb6f128c30e42fabcdebbacc07e18b3f", "type": "github" }, "original": { @@ -159,10 +160,7 @@ }, "home-manager_2": { "inputs": { - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1695108154, @@ -181,7 +179,7 @@ }, "home-manager_3": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1698128422, @@ -209,13 +207,12 @@ "nur": "nur" }, "locked": { - "lastModified": 1698175494, - "narHash": "sha256-NtyuuJGBFpaCqNsEVW9JZT8/3Zp2N8oi/W5GIpCDg9Y=", - "ref": "refs/heads/testing", - "rev": "b27a11bb37445c941cb5ad610292358a5d184773", - "revCount": 123, - "type": "git", - "url": "file:///materus/config/Nixerus" + "lastModified": 1698411224, + "narHash": "sha256-y4Q7fl0YRkl+TDPxQLMDO1wtEDXLYn/kI3H4Ejn60Yo=", + "owner": "materusPL", + "repo": "Nixerus", + "rev": "b94af8812cac55a1b33fd93cca52ab5a816ab03a", + "type": "github" }, "original": { "owner": "materusPL", @@ -237,11 +234,11 @@ "nur": "nur_3" }, "locked": { - "lastModified": 1698175745, - "narHash": "sha256-qlvZjrDUL7KSiu7z8zotYvP7qaD3kKVm/2q86U23K70=", + "lastModified": 1698411224, + "narHash": "sha256-y4Q7fl0YRkl+TDPxQLMDO1wtEDXLYn/kI3H4Ejn60Yo=", "owner": "materusPL", "repo": "Nixerus", - "rev": "5518d2e80ad61b7efb10ddab3aad50d4366e0cd1", + "rev": "b94af8812cac55a1b33fd93cca52ab5a816ab03a", "type": "github" }, "original": { @@ -267,29 +264,45 @@ "type": "github" } }, - "nixpkgs": { + "nixos-hardware_2": { "locked": { - "lastModified": 1697456312, - "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", + "lastModified": 1698053470, + "narHash": "sha256-sP8D/41UiwC2qn0X40oi+DfuVzNHMROqIWdSdCI/AYA=", "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", + "repo": "nixos-hardware", + "rev": "80d98a7d55c6e27954a166cb583a41325e9512d7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1698288402, + "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1697851979, - "narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", + "lastModified": 1698288402, + "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8", + "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", "type": "github" }, "original": { @@ -332,6 +345,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1697456312, + "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1697723726, "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", @@ -363,11 +392,11 @@ }, "nur_2": { "locked": { - "lastModified": 1698169592, - "narHash": "sha256-KBDKzeQE5nOEZtmjvPqg+Pc/dB4rYM7MUQ8I3AFKEl0=", + "lastModified": 1698423370, + "narHash": "sha256-TZpHcxo2j4qc+vXn1gtbKSrphv4G8tKAbd+YDcepw9A=", "owner": "nix-community", "repo": "NUR", - "rev": "468cc0c10a766f5ace6f66d7f46f1b7c42b8b9ac", + "rev": "cdbebbc0c521ae11acccf49acbb9f3cf25eed43c", "type": "github" }, "original": { @@ -393,11 +422,11 @@ }, "nur_4": { "locked": { - "lastModified": 1698406144, - "narHash": "sha256-UZSg8vqtavLx+e0kfTooOZUqr+G533sG0oe900qloq8=", + "lastModified": 1698423370, + "narHash": "sha256-TZpHcxo2j4qc+vXn1gtbKSrphv4G8tKAbd+YDcepw9A=", "owner": "nix-community", "repo": "NUR", - "rev": "4a4d1f3e77250d21250c5ea1787d42d4f74ca985", + "rev": "cdbebbc0c521ae11acccf49acbb9f3cf25eed43c", "type": "github" }, "original": { @@ -442,7 +471,7 @@ "configInputs": "configInputs", "configInputs-stable": "configInputs-stable", "home-manager": "home-manager_3", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable_3", "nur": "nur_5", "private": "private"