From 747524493d76461a95218e706865b42c85d2306f Mon Sep 17 00:00:00 2001 From: tootbrute Date: Sun, 12 Jan 2025 19:22:01 +0800 Subject: [PATCH] first commit --- README.md | 39 ++-------------- flake.nix | 52 +++------------------- hosts/aspirenix/configuration.nix | 45 ------------------- hosts/aspirenix/hardware-configuration.nix | 44 ------------------ hosts/bluenix/configuration.nix | 52 ---------------------- hosts/bluenix/hardware-configuration.nix | 40 ----------------- home.nix => nixosModules/home.nix | 0 7 files changed, 9 insertions(+), 263 deletions(-) delete mode 100644 hosts/aspirenix/configuration.nix delete mode 100644 hosts/aspirenix/hardware-configuration.nix delete mode 100644 hosts/bluenix/configuration.nix delete mode 100644 hosts/bluenix/hardware-configuration.nix rename home.nix => nixosModules/home.nix (100%) diff --git a/README.md b/README.md index cf386a1..bb881a7 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,5 @@ # My NixOS Flake Config -My NixOS repo with that has the configs for 2 of my NixOS machines. +My NixOS repo for a single machine. -## NOTE: Archived. -I don't use this anymore. It got too complicated with multiple machines. - -# Structure of NixOS Config - -```. -├── flake.lock -├── flake.nix -├── flatpak-install.sh -├── home.nix -├── hosts -│   ├── aspirenix -│   │   ├── configuration.nix -│   │   └── hardware-configuration.nix -│   ├── bluenix -│   │   ├── configuration.nix -│   │   └── hardware-configuration.nix -│   └── greynix -│   ├── configuration.nix -│   └── hardware-configuration.nix -├── nixosModules -│   ├── base.nix -│   ├── docker.nix -│   ├── fonts.nix -│   ├── gnome.nix -│   ├── module-docker.nix -│   ├── module-modules.nix -│   └── systemd.nix -├── nix-upgrade.sh -├── pull.sh -├── README.md -├── rebuild.sh -├── temp-non-declarative-stuff.txt -└── update.sh -``` +- Flakes +- Homemanager diff --git a/flake.nix b/flake.nix index b843c1a..ac258b2 100644 --- a/flake.nix +++ b/flake.nix @@ -21,54 +21,14 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.elias = import ./home.nix; + home-manager.users.elias = import .nixosModules/home.nix; # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix - } #close home-manager - ]; #close modules - }; #close greynix + } + ]; + }; - # bluenix - Blue Acer machine - bluenix = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./nixosModules/base.nix - ./hosts/bluenix/configuration.nix - ./nixosModules/docker.nix - - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.elias = import ./home.nix; - - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - } #close homemanager - ]; #close modules - }; # close bluenix - - # aspirenix - Grey Acer Aspire machine - # low spec machine - need to figure out how to change this config a bit - aspirenix = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./nixosModules/base.nix - ./hosts/aspirenix/configuration.nix - - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.elias = import ./home.nix; - - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - } #close homemanager - ]; #close modules - }; # close bluenix - - }; #close nixosconfigurations - }; #close outputs + }; + }; } diff --git a/hosts/aspirenix/configuration.nix b/hosts/aspirenix/configuration.nix deleted file mode 100644 index dce3081..0000000 --- a/hosts/aspirenix/configuration.nix +++ /dev/null @@ -1,45 +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’). - -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.initrd.luks.devices."luks-b665cacd-d82b-44cd-ab4a-61018efec103".device = "/dev/disk/by-uuid/b665cacd-d82b-44cd-ab4a-61018efec103"; - - networking.hostName = "aspirenix"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # 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.elias = { - isNormalUser = true; - description = "Elias Gasparis"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - # thunderbird - htop - ]; - }; - - # 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 = "24.11"; # Did you read the comment? - -} diff --git a/hosts/aspirenix/hardware-configuration.nix b/hosts/aspirenix/hardware-configuration.nix deleted file mode 100644 index d715972..0000000 --- a/hosts/aspirenix/hardware-configuration.nix +++ /dev/null @@ -1,44 +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 = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "uas" "sd_mod" "rtsx_usb_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - zramSwap.enable = true; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/f4554a8a-b8d9-4c9e-bea9-c39452383e62"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-8ae34699-9999-47dc-bc01-269b01f7c9bc".device = "/dev/disk/by-uuid/8ae34699-9999-47dc-bc01-269b01f7c9bc"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/E0DA-830C"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/fcd6ecf9-3d4d-4cb1-b217-957bae8fbc3f"; } - ]; - - # 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.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/bluenix/configuration.nix b/hosts/bluenix/configuration.nix deleted file mode 100644 index fecb8f2..0000000 --- a/hosts/bluenix/configuration.nix +++ /dev/null @@ -1,52 +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’). - -# BLUENIX CONFIG FILE - -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # to make epson work - hardware.sane.enable = true; # enables support for SANE scanners - - zramSwap.enable = true; - - networking.hostName = "bluenix"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - hardware.bluetooth.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.elias = { - isNormalUser = true; - description = "Elias Gasparis"; - extraGroups = [ "networkmanager" "wheel" "scanner"]; - packages = with pkgs; [ - # thunderbird - ]; - }; - - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 22 ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # 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 = "24.05"; # Did you read the comment? - -} diff --git a/hosts/bluenix/hardware-configuration.nix b/hosts/bluenix/hardware-configuration.nix deleted file mode 100644 index 49f9707..0000000 --- a/hosts/bluenix/hardware-configuration.nix +++ /dev/null @@ -1,40 +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 = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/9bd500b5-1d06-4ccf-b7c2-5338e8555a5a"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-6cfc6952-9e66-4e10-b181-97278f99bf2f".device = "/dev/disk/by-uuid/6cfc6952-9e66-4e10-b181-97278f99bf2f"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4F9E-9FFF"; - 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.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/home.nix b/nixosModules/home.nix similarity index 100% rename from home.nix rename to nixosModules/home.nix