From b1a3561040177e56221d82c3fd8706e34c99a68c Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Fri, 14 Mar 2025 16:30:17 +0100 Subject: [PATCH 1/3] blub --- flake.lock | 79 +++++++++++++++++++ flake.nix | 15 +++- .../hummingbird/configuration.nix | 1 + home.nix => hosts/hummingbird/home.nix | 0 4 files changed, 91 insertions(+), 4 deletions(-) rename configuration.nix => hosts/hummingbird/configuration.nix (99%) rename home.nix => hosts/hummingbird/home.nix (100%) diff --git a/flake.lock b/flake.lock index 8688e7b..8db08a1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,50 @@ { "nodes": { + "alejandra": { + "inputs": { + "fenix": "fenix", + "flakeCompat": "flakeCompat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730688725, + "narHash": "sha256-g0SSfTWZ5mtMOpQic+eqq9sXMy1E/7yKxxfupZd9V4A=", + "owner": "kamadorueda", + "repo": "alejandra", + "rev": "2bb91e309ca99656addff5c74545acbf5813636d", + "type": "github" + }, + "original": { + "owner": "kamadorueda", + "ref": "3.1.0", + "repo": "alejandra", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "alejandra", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1730615655, + "narHash": "sha256-2HBR3zLn57LXKNRtxBb+O+uDqHM4n0pz51rPayMl4cg=", + "owner": "nix-community", + "repo": "fenix", + "rev": "efeb50e2535b17ffd4a135e6e3e5fd60a525180c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -36,6 +81,22 @@ "type": "github" } }, + "flakeCompat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -183,11 +244,29 @@ }, "root": { "inputs": { + "alejandra": "alejandra", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nvf": "nvf" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1730555913, + "narHash": "sha256-KNHZUlqsEibg3YtfUyOFQSofP8hp1HKoY+laoesBxRM=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "f17a5bbfd0969ba2e63a74505a80e55ecb174ed9", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 2207f07..a24c52a 100644 --- a/flake.nix +++ b/flake.nix @@ -6,13 +6,16 @@ nvf.url = "github:notashelf/nvf"; + alejandra.url = "github:kamadorueda/alejandra/3.1.0"; + alejandra.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, home-manager, nvf, ... }@inputs: { + outputs = { self, nixpkgs, home-manager, nvf, alejandra, ... }@inputs: { # use "nixos", or your hostname as the name of the configuration # it's a better practice than "default" shown in the video @@ -26,10 +29,14 @@ nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ - ./configuration.nix + { + environment.systemPackages = [alejandra.defaultPackage.x86_64-linux]; + } + + ./hosts/hummingbird/configuration.nix inputs.home-manager.nixosModules.default - nvf.nixosModules.default - ./nvf-configuration.nix + nvf.nixosModules.default + ./nvf-configuration.nix ]; }; }; diff --git a/configuration.nix b/hosts/hummingbird/configuration.nix similarity index 99% rename from configuration.nix rename to hosts/hummingbird/configuration.nix index 2104e1b..1d92d21 100644 --- a/configuration.nix +++ b/hosts/hummingbird/configuration.nix @@ -99,6 +99,7 @@ git neovim rustup + vscode.fhs ]; }; diff --git a/home.nix b/hosts/hummingbird/home.nix similarity index 100% rename from home.nix rename to hosts/hummingbird/home.nix From 6411787299a66f7b5084682720dd73e1d7f6c025 Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Fri, 14 Mar 2025 16:31:00 +0100 Subject: [PATCH 2/3] blub --- .../hummingbird/hardware-configuration.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hardware-configuration.nix => hosts/hummingbird/hardware-configuration.nix (100%) diff --git a/hardware-configuration.nix b/hosts/hummingbird/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/hummingbird/hardware-configuration.nix From 254c96399846d689233730a8138d6302e1344612 Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Fri, 14 Mar 2025 16:38:33 +0100 Subject: [PATCH 3/3] format --- flake.nix | 54 ++++++++++------- hosts/hummingbird/configuration.nix | 54 +++++++++-------- hosts/hummingbird/hardware-configuration.nix | 64 +++++++++++--------- hosts/hummingbird/home.nix | 6 +- nvf-configuration.nix | 48 ++++++++------- 5 files changed, 122 insertions(+), 104 deletions(-) diff --git a/flake.nix b/flake.nix index a24c52a..524fc6d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - + nvf.url = "github:notashelf/nvf"; alejandra.url = "github:kamadorueda/alejandra/3.1.0"; @@ -15,30 +15,38 @@ }; }; - outputs = { self, nixpkgs, home-manager, nvf, alejandra, ... }@inputs: { + outputs = { + self, + nixpkgs, + home-manager, + nvf, + alejandra, + ... + } @ inputs: { # use "nixos", or your hostname as the name of the configuration # it's a better practice than "default" shown in the video - - packages."x86_64-linux".default = - (nvf.lib.neovimConfiguration { - pkgs = nixpkgs.legacyPackages."x86_64-linux"; - modules = [ ./nvf-configuration.nix ]; - }).neovim; - - nixosConfigurations = { - nixos = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - { - environment.systemPackages = [alejandra.defaultPackage.x86_64-linux]; - } - ./hosts/hummingbird/configuration.nix - inputs.home-manager.nixosModules.default - nvf.nixosModules.default - ./nvf-configuration.nix - ]; - }; - }; + packages."x86_64-linux".default = + (nvf.lib.neovimConfiguration { + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + modules = [./nvf-configuration.nix]; + }) + .neovim; + + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + { + environment.systemPackages = [alejandra.defaultPackage.x86_64-linux]; + } + + ./hosts/hummingbird/configuration.nix + inputs.home-manager.nixosModules.default + nvf.nixosModules.default + ./nvf-configuration.nix + ]; + }; }; + }; } diff --git a/hosts/hummingbird/configuration.nix b/hosts/hummingbird/configuration.nix index 1d92d21..98b5f33 100644 --- a/hosts/hummingbird/configuration.nix +++ b/hosts/hummingbird/configuration.nix @@ -1,29 +1,31 @@ # 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, lib, pkgs, inputs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ]; + config, + lib, + pkgs, + inputs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - - # mask dev-tpmrm0.device - systemd.services.dev-tpmrm0.wantedBy = lib.mkForce[ ]; + # mask dev-tpmrm0.device + systemd.services.dev-tpmrm0.wantedBy = lib.mkForce []; networking.hostName = "nixos"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - + # flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; @@ -92,17 +94,17 @@ users.users.luna = { isNormalUser = true; description = "luna"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = ["networkmanager" "wheel"]; packages = with pkgs; [ - # thunderbird - gnome-software - git - neovim - rustup - vscode.fhs + # thunderbird + gnome-software + git + neovim + rustup + vscode.fhs ]; }; - + # flatpak services.flatpak.enable = true; @@ -112,9 +114,9 @@ # 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 - gnome-menus + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + gnome-menus ]; # Some programs need SUID wrappers, can be configured further or are @@ -128,7 +130,7 @@ # ssh agent programs.ssh.startAgent = true; - hardware.ckb-next.enable = true; + hardware.ckb-next.enable = true; # dynamic linking programs.nix-ld.enable = true; @@ -153,7 +155,7 @@ # 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? - + programs.steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play diff --git a/hosts/hummingbird/hardware-configuration.nix b/hosts/hummingbird/hardware-configuration.nix index 31adb34..f1c346e 100644 --- a/hosts/hummingbird/hardware-configuration.nix +++ b/hosts/hummingbird/hardware-configuration.nix @@ -1,42 +1,46 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "ums_realtek" "usbhid" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ "sg" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "ums_realtek" "usbhid" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = ["sg"]; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/d3942c4d-eca8-41e2-afa7-57ba5704e86f"; - fsType = "ext4"; - }; - - fileSystems."/mnt/sda1" = - { device = "/dev/disk/by-uuid/22847bcf-830f-484b-9ff8-dec259e4a990"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/d3942c4d-eca8-41e2-afa7-57ba5704e86f"; + fsType = "ext4"; + }; - fileSystems."/mnt/sdb1" = - { device = "/dev/disk/by-uuid/21301a6f-2937-421d-81ec-e2e9be139b0a"; - fsType = "ext4"; - }; + fileSystems."/mnt/sda1" = { + device = "/dev/disk/by-uuid/22847bcf-830f-484b-9ff8-dec259e4a990"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/B44E-D001"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/mnt/sdb1" = { + device = "/dev/disk/by-uuid/21301a6f-2937-421d-81ec-e2e9be139b0a"; + fsType = "ext4"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/f054feb9-61b1-41f3-b0b2-6e48bfcc6655"; } - ]; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/B44E-D001"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f054feb9-61b1-41f3-b0b2-6e48bfcc6655";} + ]; # 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 diff --git a/hosts/hummingbird/home.nix b/hosts/hummingbird/home.nix index 47263bb..538acab 100644 --- a/hosts/hummingbird/home.nix +++ b/hosts/hummingbird/home.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "luna"; diff --git a/nvf-configuration.nix b/nvf-configuration.nix index de03f2b..015c7e4 100644 --- a/nvf-configuration.nix +++ b/nvf-configuration.nix @@ -1,25 +1,27 @@ -{ pkgs, lib, ... }: - { - programs.nvf = { - enable = true; - settings.vim = { - theme = { - enable = true; - name = "catppuccin"; - style = "macchiato"; - }; - - statusline.lualine.enable = true; - telescope.enable = true; - - languages = { - enableLSP = true; - enableTreesitter = true; - - nix.enable = true; - rust.enable = true; - }; - }; - }; + pkgs, + lib, + ... +}: { + programs.nvf = { + enable = true; + settings.vim = { + theme = { + enable = true; + name = "catppuccin"; + style = "macchiato"; + }; + + statusline.lualine.enable = true; + telescope.enable = true; + + languages = { + enableLSP = true; + enableTreesitter = true; + + nix.enable = true; + rust.enable = true; + }; + }; + }; }