feat (hosts/elistraee): add nixos-wsl config
This commit is contained in:
parent
d1c0846cf8
commit
7955b8220f
12 changed files with 243 additions and 143 deletions
39
flake.lock
generated
39
flake.lock
generated
|
|
@ -1,5 +1,21 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -21,6 +37,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1768814707,
|
||||
"narHash": "sha256-hiEtU10R8X8LuFCx0olNTaFGWV1CWF9aagd3wwfcKXE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "f80fde12cd9d5ff02b1c6eb612b853c1ac5ecc32",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.11",
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1769598131,
|
||||
|
|
@ -40,6 +78,7 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
29
flake.nix
29
flake.nix
|
|
@ -5,34 +5,41 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
home-manager.url = "github:nix-community/home-manager/release-25.11";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixos-wsl.url = "github:nix-community/NixOS-WSL/release-25.11";
|
||||
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, home-manager, ... }:
|
||||
let
|
||||
home-manager-options = {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.hms = ./home;
|
||||
home-manager.backupFileExtension = "bak";
|
||||
};
|
||||
in
|
||||
{ nixpkgs, home-manager, nixos-wsl, ... }@inputs:
|
||||
{
|
||||
nixosConfigurations.selune = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./hosts/selune
|
||||
home-manager.nixosModules.home-manager
|
||||
home-manager-options
|
||||
./home
|
||||
];
|
||||
};
|
||||
nixosConfigurations.shar = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./hosts/shar
|
||||
home-manager.nixosModules.home-manager
|
||||
home-manager-options
|
||||
./home
|
||||
];
|
||||
};
|
||||
nixosConfigurations.elistraee = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./hosts/elistraee
|
||||
nixos-wsl.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./home
|
||||
];
|
||||
};
|
||||
homeManagerModules.default = ./home;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
lib,
|
||||
# enableGraphical ? false,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./cli.nix
|
||||
./graphical.nix
|
||||
]
|
||||
#++ (lib.optionals (enableGraphical) [ ./graphical.nix ])
|
||||
;
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users."hms" = ./home.nix;
|
||||
backupFileExtension = "bak";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config = lib.mkIf config.graphical.enable {
|
||||
home = {
|
||||
packages =
|
||||
with pkgs;
|
||||
|
|
@ -98,4 +99,5 @@
|
|||
binding = "<Super>d";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
7
home/home.nix
Normal file
7
home/home.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./cli.nix
|
||||
./graphical.nix
|
||||
];
|
||||
}
|
||||
11
hosts/elistraee/default.nix
Normal file
11
hosts/elistraee/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ ../../nixos ];
|
||||
|
||||
nixos-wsl.enable = true; # Enables wsl configuration (nixos/wsl.nix).
|
||||
|
||||
networking.hostName = "elistraee";
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-tty;
|
||||
}
|
||||
|
|
@ -5,6 +5,9 @@
|
|||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
baremetal.enable = true; # Enables baremetal features (nixos/baremetal.nix).
|
||||
graphical.enable = true; # Enables graphical features (nixos/graphical.nix).
|
||||
|
||||
boot.initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device =
|
||||
"/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
baremetal.enable = true; # Enables baremetal features (nixos/baremetal.nix).
|
||||
graphical.enable = true; # Enables graphical features (nixos/graphical.nix).
|
||||
|
||||
boot.initrd.luks.devices."luks-324ce23c-e630-42a1-8558-184e999053a5".device =
|
||||
"/dev/disk/by-uuid/324ce23c-e630-42a1-8558-184e999053a5";
|
||||
|
||||
|
|
|
|||
27
nixos/baremetal.nix
Normal file
27
nixos/baremetal.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
baremetal.enable = lib.mkEnableOption "enables bare metal features";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.baremetal.enable {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
users.users.hms.extraGroups = [ "networkmanager" ];
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
console.keyMap = "fr";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./baremetal.nix
|
||||
./wsl.nix
|
||||
./graphical.nix
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
|
||||
system.autoUpgrade.enable = true;
|
||||
|
|
@ -10,12 +16,6 @@
|
|||
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;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
|
|
@ -30,35 +30,10 @@
|
|||
LC_TIME = "fr_FR.UTF-8";
|
||||
};
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.xkb.layout = "fr";
|
||||
services.xserver.xkb.variant = "ergol";
|
||||
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
services.gnome.gnome-browser-connector.enable = true;
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
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"
|
||||
];
|
||||
extraGroups = [ "wheel" ];
|
||||
packages = [ ];
|
||||
};
|
||||
|
||||
|
|
@ -69,6 +44,8 @@
|
|||
wget
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
|
|
|
|||
16
nixos/graphical.nix
Normal file
16
nixos/graphical.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
graphical.enable = lib.mkEnableOption "enables graphical features";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.graphical.enable {
|
||||
services.xserver.enable = true;
|
||||
services.xserver.xkb.layout = "fr";
|
||||
services.xserver.xkb.variant = "ergol";
|
||||
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
services.gnome.gnome-browser-connector.enable = true;
|
||||
};
|
||||
}
|
||||
11
nixos/wsl.nix
Normal file
11
nixos/wsl.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
nixos-wsl.enable = lib.mkEnableOption "enables WSL support";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.nixos-wsl.enable {
|
||||
wsl.enable = true;
|
||||
wsl.defaultUser = "hms";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue