From a83e3592b20a7e0154eca335b4605952726be040 Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Tue, 15 Oct 2024 21:04:30 +0200 Subject: [PATCH] forward --- flake.lock | 24 ++++----- flake.nix | 19 +++---- hosts/{ => crocoite}/crocoite.nix | 50 +++++++++---------- .../crocoite/hardware-configuration.nix | 0 modules/software/audio_video.nix | 3 +- modules/software/software.nix | 5 +- 6 files changed, 52 insertions(+), 49 deletions(-) rename hosts/{ => crocoite}/crocoite.nix (52%) rename hardware-configuration.nix => hosts/crocoite/hardware-configuration.nix (100%) diff --git a/flake.lock b/flake.lock index f413119..3cb63bb 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nix-flatpak": { "locked": { - "lastModified": 1721549352, - "narHash": "sha256-nlXJa8RSOX0kykrIYW33ukoHYq+FOSNztHLLgqKwOp8=", + "lastModified": 1728416205, + "narHash": "sha256-t30gsrwiBc2oBsd89DwdsVZuEbMT5ed81PYY57CIOJE=", "owner": "gmodena", "repo": "nix-flatpak", - "rev": "dbce39ea8664820ba9037caaf1e2fad365ed6b4b", + "rev": "d65dbf59900de4beaaaba8b42a15994f8433c1bc", "type": "github" }, "original": { @@ -38,11 +38,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1727437159, - "narHash": "sha256-v4qLwEw5OmprgQZTT7KZMNU7JjXJzRypw8+Cw6++fWk=", + "lastModified": 1728729581, + "narHash": "sha256-oazkQ/z7r43YkDLLQdMg8oIB3CwWNb+2ZrYOxtLEWTQ=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "d830ad47cc992b4a46b342bbc79694cbd0e980b2", + "rev": "a8dd1b21995964b115b1e3ec639dd6ce24ab9806", "type": "github" }, "original": { @@ -54,11 +54,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727264057, - "narHash": "sha256-KQPI8CTTnB9CrJ7LrmLC4VWbKZfljEPBXOFGZFRpxao=", + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "759537f06e6999e141588ff1c9be7f3a5c060106", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "lastModified": 1728888510, + "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6ad7d08..2471488 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,15 @@ # This is a function that generates an attribute by calling a function you # pass to it, with each system as an argument forAllSystems = nixpkgs.lib.genAttrs systems; + + host_helper = hostname: { + ${hostname} = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./hosts/${hostname}/${hostname}.nix + ]; + }; + }; in { # Your custom packages # Accessible through 'nix build', 'nix shell', etc @@ -65,15 +74,7 @@ # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' - nixosConfigurations = { - crocoite = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - # > Our main nixos configuration file < - ./hosts/crocoite.nix - ]; - }; - }; + nixosConfigurations = host_helper "crocoite"; # // (host_helper example); ## Standalone home-manager configuration entrypoint ## Available through 'home-manager --flake .#your-username@your-hostname' diff --git a/hosts/crocoite.nix b/hosts/crocoite/crocoite.nix similarity index 52% rename from hosts/crocoite.nix rename to hosts/crocoite/crocoite.nix index e8c99ff..d236a4a 100644 --- a/hosts/crocoite.nix +++ b/hosts/crocoite/crocoite.nix @@ -30,38 +30,38 @@ inputs.nix-flatpak.nixosModules.nix-flatpak #nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 - ../hardware-configuration.nix + ./hardware-configuration.nix - ../modules/basic_system_config.nix - ../modules/networking.nix - ../modules/boot_theming.nix + ../../modules/basic_system_config.nix + ../../modules/networking.nix + ../../modules/boot_theming.nix - ../modules/specific_hardware/scan_and_print.nix - ../modules/specific_hardware/fwupd.nix - ../modules/specific_hardware/bluetooth.nix + ../../modules/specific_hardware/scan_and_print.nix + ../../modules/specific_hardware/fwupd.nix + ../../modules/specific_hardware/bluetooth.nix - ../modules/sec_auth/firejail.nix - ../modules/sec_auth/login-manager.nix - ../modules/sec_auth/users_and_permissions.nix - ../modules/sec_auth/ssh.nix + ../../modules/sec_auth/firejail.nix + ../../modules/sec_auth/login-manager.nix + ../../modules/sec_auth/users_and_permissions.nix + ../../modules/sec_auth/ssh.nix - ../modules/software/software.nix - ../modules/software/virt.nix - ../modules/software/game.nix - ../modules/software/audio_video.nix - ../modules/software/obs-studio.nix + ../../modules/software/software.nix + ../../modules/software/virt.nix + ../../modules/software/game.nix + ../../modules/software/audio_video.nix + ../../modules/software/obs-studio.nix - ../modules/wm_and_de/hyprland.nix + ../../modules/wm_and_de/hyprland.nix - ../modules/pkg_mgrmnt/flatpak.nix - ../modules/pkg_mgrmnt/podman.nix - ../modules/pkg_mgrmnt/store_pkg_file.nix + ../../modules/pkg_mgrmnt/flatpak.nix + ../../modules/pkg_mgrmnt/podman.nix + ../../modules/pkg_mgrmnt/store_pkg_file.nix - ../modules/software/nix-helper/index.nix - ../modules/software/nix-helper/doc.nix - ../modules/software/nix-helper/nix-ld.nix + ../../modules/software/nix-helper/index.nix + ../../modules/software/nix-helper/doc.nix + ../../modules/software/nix-helper/nix-ld.nix - ../modules/software/browser/firefox.nix - ../modules/software/browser/brave.nix + ../../modules/software/browser/firefox.nix + ../../modules/software/browser/brave.nix ]; } diff --git a/hardware-configuration.nix b/hosts/crocoite/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/crocoite/hardware-configuration.nix diff --git a/modules/software/audio_video.nix b/modules/software/audio_video.nix index 8ba0b38..0b9b463 100644 --- a/modules/software/audio_video.nix +++ b/modules/software/audio_video.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - # Enable sound with pipewire. + # Enable sound with pipewire hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -50,6 +50,7 @@ }; environment.systemPackages = with pkgs; [ helvum + qpwgraph easyeffects pwvucontrol lxqt.pavucontrol-qt diff --git a/modules/software/software.nix b/modules/software/software.nix index dbb8095..605821b 100644 --- a/modules/software/software.nix +++ b/modules/software/software.nix @@ -1,10 +1,11 @@ { pkgs, inputs, - config, ... }: let - unstable_list = [inputs.nixpkgs-unstable.legacyPackages."x86_64-linux".neovim]; + unstable_list = [ + inputs.nixpkgs-unstable.legacyPackages."x86_64-linux".neovim + ]; in { # also opens the TCP and UDP port from 1714 to 1764 programs.kdeconnect.enable = true;