From 5ecec01bcc1ab212644f7aeed2203603c5029d64 Mon Sep 17 00:00:00 2001 From: Frank Lyder Bredland Date: Fri, 12 Jul 2024 22:25:29 +0200 Subject: [PATCH] nixos refactor structure --- os/nixos/flake.lock | 89 ++++++++++++++++++- os/nixos/flake.nix | 14 ++- .../{machine => host/mods}/audio-video.nix | 0 os/nixos/{machine => host/mods}/steam.nix | 0 os/nixos/{machine => host/mods}/virtual.nix | 0 .../nixos.config.nix} | 43 ++++----- .../nixos.hardware.nix} | 0 7 files changed, 119 insertions(+), 27 deletions(-) rename os/nixos/{machine => host/mods}/audio-video.nix (100%) rename os/nixos/{machine => host/mods}/steam.nix (100%) rename os/nixos/{machine => host/mods}/virtual.nix (100%) rename os/nixos/{machine/configuration.nix => host/nixos.config.nix} (68%) rename os/nixos/{machine/hardware-configuration.nix => host/nixos.hardware.nix} (100%) diff --git a/os/nixos/flake.lock b/os/nixos/flake.lock index 220cb5f..45929ce 100644 --- a/os/nixos/flake.lock +++ b/os/nixos/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "ags": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1718921313, + "narHash": "sha256-TFJah1RW5qnYW7kajjAFPAS5j/0q0R3vz9zPjrRA0Mc=", + "owner": "Aylur", + "repo": "ags", + "rev": "646d5ad073ff7f8b1d50cfbd40f5b8a250fcd59d", + "type": "github" + }, + "original": { + "owner": "Aylur", + "repo": "ags", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -77,6 +95,56 @@ "url": "https://github.com/hyprwm/Hyprland" } }, + "hyprland-hyprspace": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1720553729, + "narHash": "sha256-9aM4MCBJn4UstcsSdukOFTxg79keUMTw9Kmqr7Wsfmw=", + "owner": "KZDKM", + "repo": "Hyprspace", + "rev": "e8662093ae5b6e13a3cf1145d21d4804a3e84aeb", + "type": "github" + }, + "original": { + "owner": "KZDKM", + "repo": "Hyprspace", + "type": "github" + } + }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nixpkgs": [ + "hyprland-plugins", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-plugins", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1719784423, + "narHash": "sha256-D7O5+nh2Wn9tQPJArWHrDSZeEfBCtj5zTGd86701LPE=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "98cb18c6fcfe8196ef4150d09fbae305b7bb2954", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, "hyprland-protocols": { "inputs": { "nixpkgs": [ @@ -184,6 +252,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1720418205, "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", @@ -201,9 +285,12 @@ }, "root": { "inputs": { + "ags": "ags", "home-manager": "home-manager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs" + "hyprland-hyprspace": "hyprland-hyprspace", + "hyprland-plugins": "hyprland-plugins", + "nixpkgs": "nixpkgs_2" } }, "systems": { diff --git a/os/nixos/flake.nix b/os/nixos/flake.nix index 8ff2ee8..8a86750 100644 --- a/os/nixos/flake.nix +++ b/os/nixos/flake.nix @@ -13,6 +13,18 @@ url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; inputs.nixpkgs.follows = "nixpkgs"; }; + + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; + }; + + hyprland-hyprspace = { + url = "github:KZDKM/Hyprspace"; + inputs.hyprland.follows = "hyprland"; + }; + + ags.url = "github:Aylur/ags"; }; outputs = { nixpkgs, home-manager, hyprland, ... } @ inputs: @@ -32,7 +44,7 @@ inherit system; modules = [ - ./machine/configuration.nix + ./host/nixos.config.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/os/nixos/machine/audio-video.nix b/os/nixos/host/mods/audio-video.nix similarity index 100% rename from os/nixos/machine/audio-video.nix rename to os/nixos/host/mods/audio-video.nix diff --git a/os/nixos/machine/steam.nix b/os/nixos/host/mods/steam.nix similarity index 100% rename from os/nixos/machine/steam.nix rename to os/nixos/host/mods/steam.nix diff --git a/os/nixos/machine/virtual.nix b/os/nixos/host/mods/virtual.nix similarity index 100% rename from os/nixos/machine/virtual.nix rename to os/nixos/host/mods/virtual.nix diff --git a/os/nixos/machine/configuration.nix b/os/nixos/host/nixos.config.nix similarity index 68% rename from os/nixos/machine/configuration.nix rename to os/nixos/host/nixos.config.nix index 6e6e35a..ce78808 100644 --- a/os/nixos/machine/configuration.nix +++ b/os/nixos/host/nixos.config.nix @@ -2,23 +2,32 @@ { imports = [ - ./hardware-configuration.nix - ./steam.nix - ./audio-video.nix - ./virtual.nix + # Hardware configuration + ./nixos.hardware.nix + + # Modules + ./mods/steam.nix + ./mods/audio-video.nix + ./mods/virtual.nix ]; # Enable flakes nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Bootloader - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + }; # Enable networking - networking.hostName = "nixos"; - networking.interfaces.enp5s0.wakeOnLan.enable = true; - networking.networkmanager.enable = true; + networking = { + networkmanager.enable = true; + hostName = "nixos"; + + # Enable wake on lan + interfaces.enp5s0.wakeOnLan.enable = true; + }; # Time zone & locale time.timeZone = "Europe/Oslo"; @@ -64,22 +73,6 @@ programs.zsh.enable = true; -/* - home-manager.users.knarf = { pkgs, ... }: { - # The state version is required and should stay at the version you - # originally installed. - home.stateVersion = "24.05"; - }; -*/ - - # 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; - # }; - # Enable the OpenSSH daemon. services.openssh.enable = true; diff --git a/os/nixos/machine/hardware-configuration.nix b/os/nixos/host/nixos.hardware.nix similarity index 100% rename from os/nixos/machine/hardware-configuration.nix rename to os/nixos/host/nixos.hardware.nix