diff --git a/README.md b/README.md index 619546b..5cd8455 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ # Nixos configuration + +``` +. +├── flake.nix // Top-level flake +├── home/ // home-manager configuration +├── hosts/ // host-specific configuration +├── nixos/ // generic system configuration +├── shells/ // generic development shells +└── [...] +``` diff --git a/flake.nix b/flake.nix index 8d80ef3..ad43fd2 100644 --- a/flake.nix +++ b/flake.nix @@ -13,12 +13,12 @@ nixosConfigurations.selune = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hosts/selune/configuration.nix + ./hosts/selune home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.hms = ./home/home.nix; + home-manager.users.hms = ./home; home-manager.backupFileExtension = "bak"; } ]; @@ -26,12 +26,12 @@ nixosConfigurations.shar = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hosts/shar/configuration.nix + ./hosts/shar home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.hms = ./home/home.nix; + home-manager.users.hms = ./home; home-manager.backupFileExtension = "bak"; } ]; diff --git a/home/home.nix b/home/default.nix similarity index 100% rename from home/home.nix rename to home/default.nix diff --git a/hosts/selune/default.nix b/hosts/selune/default.nix new file mode 100644 index 0000000..92d1616 --- /dev/null +++ b/hosts/selune/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ../../nixos + ./hardware-configuration.nix + ]; + + boot.initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device = + "/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae"; + + networking.hostName = "selune"; + system.stateVersion = "25.11"; +} diff --git a/hosts/shar/configuration.nix b/hosts/shar/configuration.nix deleted file mode 100644 index 56f731e..0000000 --- a/hosts/shar/configuration.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ ./hardware-configuration.nix ]; - - nix.settings.experimental-features = "nix-command flakes"; - - system.autoUpgrade.enable = true; - system.autoUpgrade.dates = "weekly"; - - nix.gc.automatic = true; - nix.gc.dates = "daily"; - nix.gc.options = "--delete-older-than 10d"; - nix.settings.auto-optimise-store = true; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.initrd.luks.devices."luks-324ce23c-e630-42a1-8558-184e999053a5".device = - "/dev/disk/by-uuid/324ce23c-e630-42a1-8558-184e999053a5"; - - networking.hostName = "shar"; - networking.networkmanager.enable = true; - - time.timeZone = "Europe/Paris"; - i18n.defaultLocale = "en_GB.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "fr_FR.UTF-8"; - LC_IDENTIFICATION = "fr_FR.UTF-8"; - LC_MEASUREMENT = "fr_FR.UTF-8"; - LC_MONETARY = "fr_FR.UTF-8"; - LC_NAME = "fr_FR.UTF-8"; - LC_NUMERIC = "fr_FR.UTF-8"; - LC_PAPER = "fr_FR.UTF-8"; - LC_TELEPHONE = "fr_FR.UTF-8"; - LC_TIME = "fr_FR.UTF-8"; - }; - - services.xserver.enable = true; - services.displayManager.gdm.enable = true; - services.desktopManager.gnome.enable = true; - services.xserver.xkb = { - layout = "fr"; - variant = "ergol"; - }; - - services.gnome.gnome-browser-connector.enable = true; - services.printing.enable = true; - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - services.openssh.enable = true; - - console.keyMap = "fr"; - - users.users.hms = { - isNormalUser = true; - description = "hms"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = [ ]; - }; - - - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ - helix - wget - ]; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - system.stateVersion = "25.11"; -} diff --git a/hosts/shar/default.nix b/hosts/shar/default.nix new file mode 100644 index 0000000..94c5e01 --- /dev/null +++ b/hosts/shar/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ../../nixos + ./hardware-configuration.nix + ]; + + boot.initrd.luks.devices."luks-324ce23c-e630-42a1-8558-184e999053a5".device = + "/dev/disk/by-uuid/324ce23c-e630-42a1-8558-184e999053a5"; + + networking.hostName = "shar"; + system.stateVersion = "25.11"; +} diff --git a/hosts/selune/configuration.nix b/nixos/default.nix similarity index 87% rename from hosts/selune/configuration.nix rename to nixos/default.nix index 5980ecc..c878c47 100644 --- a/hosts/selune/configuration.nix +++ b/nixos/default.nix @@ -1,7 +1,5 @@ { pkgs, ... }: { - imports = [ ./hardware-configuration.nix ]; - nix.settings.experimental-features = "nix-command flakes"; system.autoUpgrade.enable = true; @@ -15,14 +13,10 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_latest; - boot.initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device = - "/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae"; - networking.hostName = "selune"; networking.networkmanager.enable = true; time.timeZone = "Europe/Paris"; - i18n.defaultLocale = "en_GB.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "fr_FR.UTF-8"; @@ -79,6 +73,4 @@ enable = true; enableSSHSupport = true; }; - - system.stateVersion = "25.11"; }