From f1c627e392a3232ab60ccbc07c55f2c231ddeb73 Mon Sep 17 00:00:00 2001 From: Lily Anderson Date: Fri, 13 Feb 2026 13:16:48 -0600 Subject: [PATCH] Initial working config. --- flake.lock | 112 +++++++++++++++ flake.nix | 12 ++ modules/flake-parts.nix | 22 +++ modules/hosts/desktop/configuration.nix | 131 ++++++++++++++++++ modules/hosts/desktop/desktop.nix | 9 ++ .../hosts/desktop/hardware-configuration.nix | 37 +++++ 6 files changed, 323 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 modules/flake-parts.nix create mode 100644 modules/hosts/desktop/configuration.nix create mode 100644 modules/hosts/desktop/desktop.nix create mode 100644 modules/hosts/desktop/hardware-configuration.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..42d7547 --- /dev/null +++ b/flake.lock @@ -0,0 +1,112 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "import-tree": { + "locked": { + "lastModified": 1763762820, + "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=", + "owner": "vic", + "repo": "import-tree", + "rev": "3c23749d8013ec6daa1d7255057590e9ca726646", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1770841267, + "narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1764667669, + "narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "418468ac9527e799809c900eda37cbff999199b6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "import-tree": "import-tree", + "nixpkgs": "nixpkgs", + "wrappers": "wrappers" + } + }, + "wrappers": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1770971207, + "narHash": "sha256-Q56BaqKZhfMlrloGLq4+Hs1vwOgs7eVkA7TKM3pBITU=", + "owner": "Lassulus", + "repo": "wrappers", + "rev": "f77698efc5b81c3c452ed7a02a30c78e5b47bb5e", + "type": "github" + }, + "original": { + "owner": "Lassulus", + "repo": "wrappers", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..93a708d --- /dev/null +++ b/flake.nix @@ -0,0 +1,12 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + wrappers.url = "github:Lassulus/wrappers"; + flake-parts.url = "github:hercules-ci/flake-parts"; + import-tree.url = "github:vic/import-tree"; + }; + + outputs = inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules); +} diff --git a/modules/flake-parts.nix b/modules/flake-parts.nix new file mode 100644 index 0000000..8880349 --- /dev/null +++ b/modules/flake-parts.nix @@ -0,0 +1,22 @@ +{inputs, ...}: { + imports = [ + inputs.flake-parts.flakeModules.modules + ]; + + options = { + flake = inputs.flake-parts.lib.mkSubmoduleOptions { + wrapperModules = inputs.nixpkgs.lib.mkOption { + default = {}; + }; + }; + }; + + config = { + systems = [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + }; +} diff --git a/modules/hosts/desktop/configuration.nix b/modules/hosts/desktop/configuration.nix new file mode 100644 index 0000000..f80cba1 --- /dev/null +++ b/modules/hosts/desktop/configuration.nix @@ -0,0 +1,131 @@ +# 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`). + +{ inputs, lib, pkgs, self, ... }: +{ +flake.nixosModules.lily-desktop = { pkgs, ... }: { + imports = [ ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "lily-desktop"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + +# Set your time zone. + time.timeZone = "America/Chicago"; + +# Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + +# Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + + # Enable the GNOME Desktop Environment. + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + # 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.lily = { + isNormalUser = true; + extraGroups = [ "wheel" "lily" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree +git + vim + ]; + }; +users.groups.lily = { }; + 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; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # 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.11"; # Did you read the comment? +}; +} + diff --git a/modules/hosts/desktop/desktop.nix b/modules/hosts/desktop/desktop.nix new file mode 100644 index 0000000..bf295e1 --- /dev/null +++ b/modules/hosts/desktop/desktop.nix @@ -0,0 +1,9 @@ +{ inputs, lib, pkgs, self, ... }: +{ + flake.nixosConfigurations.lily-desktop = inputs.nixpkgs.lib.nixosSystem { + modules = [ + self.nixosModules.lily-desktop + ]; + }; +} + diff --git a/modules/hosts/desktop/hardware-configuration.nix b/modules/hosts/desktop/hardware-configuration.nix new file mode 100644 index 0000000..6f479a5 --- /dev/null +++ b/modules/hosts/desktop/hardware-configuration.nix @@ -0,0 +1,37 @@ +{ +flake.nixosModules.lily-desktop = { config, lib, modulesPath, pkgs, self, ... }: { + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=@nixroot" ]; + }; + + boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/8573b24b-461f-40bf-b16b-9de1207c0696"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5598-7465"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/home" = + { device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}; +}