From 552b300149624e4b46c5f2ccad36b9bfadfbb713 Mon Sep 17 00:00:00 2001 From: jay Date: Sat, 28 Jun 2025 23:17:56 +0000 Subject: [PATCH] Adding initial stuff. --- .gitignore | 2 + flake.lock | 208 +++++++++++++++++++++++++ flake.nix | 37 +++++ nodes/lappy/configuration.nix | 126 +++++++++++++++ nodes/lappy/hardware-configuration.nix | 54 +++++++ nodes/node.nix | 4 + 6 files changed, 431 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nodes/lappy/configuration.nix create mode 100644 nodes/lappy/hardware-configuration.nix create mode 100644 nodes/node.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d52506 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/build +**/sops/age/keys.txt diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f21a8f7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,208 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixverse", + "nixos-anywhere", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1734088167, + "narHash": "sha256-OIitVU+IstPbX/NWn2jLF+/sT9dVKcO2FKeRAzlyX6c=", + "owner": "nix-community", + "repo": "disko", + "rev": "d32f2d1750d61a476a236526b725ec5a32e16342", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "disko", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixverse", + "nixos-anywhere", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixverse", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750618568, + "narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixos-anywhere": { + "inputs": { + "disko": "disko", + "flake-parts": "flake-parts", + "nixos-images": "nixos-images", + "nixos-stable": "nixos-stable", + "nixpkgs": [ + "nixverse", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1740657886, + "narHash": "sha256-7kHxBQuzb7gcHzVmLGljJ4kF6BDDSYVCIxYFDmYPnAo=", + "owner": "nix-community", + "repo": "nixos-anywhere", + "rev": "77e6a4e14baa93a29952ea9f0e4a59a29cca09e9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-anywhere", + "rev": "77e6a4e14baa93a29952ea9f0e4a59a29cca09e9", + "type": "github" + } + }, + "nixos-images": { + "inputs": { + "nixos-stable": [ + "nixverse", + "nixos-anywhere", + "nixos-stable" + ], + "nixos-unstable": [ + "nixverse", + "nixos-anywhere", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1740452541, + "narHash": "sha256-aa5gPveHysMTVkxj+0iH0BdcSn8+v8lZPud+IItOSaQ=", + "owner": "nix-community", + "repo": "nixos-images", + "rev": "283bbacb81bd2c1a7b89f33e011ecabe398a564e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-images", + "type": "github" + } + }, + "nixos-stable": { + "locked": { + "lastModified": 1733808091, + "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1750969886, + "narHash": "sha256-zW/OFnotiz/ndPFdebpo3X0CrbVNf22n4DjN2vxlb58=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a676066377a2fe7457369dd37c31fd2263b662f4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixverse": { + "inputs": { + "nix-darwin": "nix-darwin", + "nixos-anywhere": "nixos-anywhere", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751120324, + "narHash": "sha256-rxxKJxxNSTPzA6q2uRCp42RqnVdJfPQQqSbFRlaUMko=", + "owner": "hgl", + "repo": "nixverse", + "rev": "04fce491c980711453df9b7e9e2006c71613baee", + "type": "github" + }, + "original": { + "owner": "hgl", + "repo": "nixverse", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixverse": "nixverse" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixverse", + "nixos-anywhere", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733761991, + "narHash": "sha256-s4DalCDepD22jtKL5Nw6f4LP5UwoMcPzPZgHWjAfqbQ=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "0ce9d149d99bc383d1f2d85f31f6ebd146e46085", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..31b4660 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + nixverse = { + url = "github:hgl/nixverse"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + nixpkgs, + nixverse, + ... + }: + nixverse.load self { + nixverse = { + inheritLib = true; + }; + devShells = nixverse.lib.forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.mkShellNoCC { + packages = with pkgs; [ + nil + nixfmt-rfc-style + nixverse.packages.${system}.nixverse + ]; + }; + } + ); + }; +} diff --git a/nodes/lappy/configuration.nix b/nodes/lappy/configuration.nix new file mode 100644 index 0000000..1bcb0ee --- /dev/null +++ b/nodes/lappy/configuration.nix @@ -0,0 +1,126 @@ +# 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. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "lappy"; # 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 = "America/Montreal"; + + # 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 xkb.options in tty. + # }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + + + + # Configure keymap in X11 + services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # services.pulseaudio.enable = true; + # OR + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + services.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; [ + tree + ]; + }; + + programs.firefox.enable = true; + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + # 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 option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.05"; # Did you read the comment? + +} + diff --git a/nodes/lappy/hardware-configuration.nix b/nodes/lappy/hardware-configuration.nix new file mode 100644 index 0000000..ebc2870 --- /dev/null +++ b/nodes/lappy/hardware-configuration.nix @@ -0,0 +1,54 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + fileSystems."/iso" = + { device = "/dev/disk/by-uuid/1980-01-01-00-00-00-00"; + fsType = "iso9660"; + }; + + fileSystems."/nix/.ro-store" = + { device = "/iso/nix-store.squashfs"; + fsType = "squashfs"; + options = [ "loop" ]; + }; + + fileSystems."/nix/.rw-store" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + fileSystems."/nix/store" = + { device = "overlay"; + fsType = "overlay"; + }; + + 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.enp0s20f0u1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nodes/node.nix b/nodes/node.nix new file mode 100644 index 0000000..7852240 --- /dev/null +++ b/nodes/node.nix @@ -0,0 +1,4 @@ +{ + os = "nixos"; + channel = "25.05"; +}