From b84d33cc851631b09df1c44ee218be3b64a972c5 Mon Sep 17 00:00:00 2001 From: Zander Thannhauser Date: Wed, 18 Jun 2025 18:19:52 -0500 Subject: [PATCH] Blah --- configuration.nix | 116 --------------------------- flake.lock | 26 +++++++ flake.nix | 155 +++++++++++++++++++++++++++++++++++++ hardware-configuration.nix | 39 ---------- runme.sh | 3 +- 5 files changed, 182 insertions(+), 157 deletions(-) delete mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 45a3673..0000000 --- a/configuration.nix +++ /dev/null @@ -1,116 +0,0 @@ -# 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’). - -# vim: set ts=2 sw=2 et: vim # - -{ config, pkgs, ... }: { - imports = [ ./hardware-configuration.nix ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "hue"; - - # Enable networking - 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"; - }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the Pantheon Desktop Environment. - services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager.lightdm.greeters.pantheon.enable = true; - services.xserver.desktopManager.pantheon.enable = true; - - services.xserver.desktopManager.pantheon.extraWingpanelIndicators = with pkgs; [ wingpanel-indicator-ayatana ]; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - options = "caps:enter"; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.zander = { - isNormalUser = true; - description = "zander"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - vim wget - pantheon-tweaks - obsidian - direnv - google-chrome - mpv - git - vlc - tree - gparted - ]; - }; - - # Install firefox. - programs.firefox.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - environment.pantheon.excludePackages = [ - pkgs.pantheon.epiphany - pkgs.pantheon.elementary-mail - pkgs.pantheon.elementary-tasks - ]; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - ]; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = 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 = "25.05"; # Did you read the comment? -} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..33478af --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1749401433, + "narHash": "sha256-HXIQzULIG/MEUW2Q/Ss47oE3QrjxvpUX7gUl4Xp6lnc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "08fcb0dcb59df0344652b38ea6326a2d8271baff", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5631241 --- /dev/null +++ b/flake.nix @@ -0,0 +1,155 @@ + +# vim: set ts=2 sw=2 et: vim # + +{ + description = "NixOS configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + }; + + outputs = inputs@{ nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs {}; + in { nixosConfigurations = { + hue = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ({ pkgs, ...}: { + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.kernelParams = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/74285f6a-b237-4372-b64c-13bd53186460"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/51E2-1C85"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + nixpkgs.hostPlatform = system; + + # not exactly sure what magic is going on here: + hardware.graphics.enable = true; + + networking.hostName = "hue"; + + networking.useDHCP = pkgs.lib.mkDefault true; + + # Enable networking + 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"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the Pantheon Desktop Environment. + services.xserver.displayManager.lightdm.enable = true; + services.xserver.displayManager.lightdm.greeters.pantheon.enable = true; + services.xserver.desktopManager.pantheon.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + options = "caps:enter"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.zander = { + isNormalUser = true; + description = "zander"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + vim wget graphviz + nix-tree htop + pantheon-tweaks + obsidian + direnv + file + sgt-puzzles + google-chrome + mpv + git + vlc + tree + gparted + ]; + }; + + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # environment.pantheon.excludePackages = [ + # pkgs.pantheon.epiphany + # pkgs.pantheon.elementary-mail + # pkgs.pantheon.elementary-tasks + # ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + # environment.systemPackages = with pkgs; [ + # ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = 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 = "25.05"; # Did you read the comment? + }) + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 3f1f5fa..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,39 +0,0 @@ -# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/74285f6a-b237-4372-b64c-13bd53186460"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/74D8-C360"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - 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.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/runme.sh b/runme.sh index eb11533..ecb82f8 100755 --- a/runme.sh +++ b/runme.sh @@ -1,5 +1,4 @@ #!/bin/sh set -ev -sudo nixos-rebuild switch --flake .# -# -I nixos-config=${PWD}/configuration.nix +sudo nixos-rebuild switch --flake .