Added WSL host

This commit is contained in:
Nickiel12 2024-07-04 23:30:56 +00:00
parent 3a56737194
commit 78361944cb
4 changed files with 156 additions and 16 deletions

View file

@ -25,7 +25,7 @@
},
"devshell": {
"inputs": {
"flake-utils": "flake-utils_4",
"flake-utils": "flake-utils_5",
"nixpkgs": [
"nixvim",
"nixpkgs"
@ -103,6 +103,22 @@
}
},
"flake-compat_2": {
"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"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@ -116,7 +132,7 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_3": {
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -211,6 +227,24 @@
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
@ -227,7 +261,7 @@
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_4",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
@ -399,6 +433,27 @@
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1719220171,
"narHash": "sha256-xywM6JoGT8AwfoOFJBTv8GRlvNu8LYqqqMS/OQ6uCgE=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "269411cfed6aab694e46f719277c972de96177bb",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "main",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1699099776,
@ -496,6 +551,22 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1718835956,
"narHash": "sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dd457de7e08c6d06789b1f5b88fc9327f4d96309",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
@ -511,7 +582,7 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_8": {
"locked": {
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
@ -530,12 +601,12 @@
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"home-manager": "home-manager_2",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_8",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@ -560,7 +631,8 @@
"home-manager": "home-manager",
"kmonad": "kmonad",
"nicks_nextcloud_integrations": "nicks_nextcloud_integrations",
"nixpkgs": "nixpkgs_6",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_7",
"nixpkgs-stable": "nixpkgs-stable",
"nixvim": "nixvim",
"utils": "utils"
@ -696,6 +768,21 @@
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@ -719,7 +806,7 @@
},
"utils": {
"inputs": {
"systems": "systems_5"
"systems": "systems_6"
},
"locked": {
"lastModified": 1710146030,

View file

@ -9,6 +9,8 @@
# url = "github:NixOS/nixpkgs/b477b25191fc94ce764428520b83b6b64366e3c8";
};
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nixpkgs-stable = {
url = "github:NixOS/nixpkgs/release-23.11";
};
@ -43,6 +45,7 @@
ewwtilities,
kmonad,
atuin,
nixos-wsl,
...
}:
let
@ -90,6 +93,40 @@
];
};
# To change username after installing: https://nix-community.github.io/NixOS-WSL/how-to/change-username.html
NicksNixWSL = lib.nixosSystem {
inherit system;
modules = [
nixos-wsl.nixosModules.default
./hosts/WSL
{
networking.hostName = "NicksNixWSL";
system.stateVersion = "24.05";
wsl.enable = true;
wsl.defaultUser = "nixolas";
}
#./hosts/WSL
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit user ewwtilities atuin pkgs-stable;
};
users.${user} = {
imports = [
(import ./home.nix)
# Add nixvim to the homemanager
inputs.nixvim.homeManagerModules.nixvim
];
};
};
}
];
};
NicksNixLaptop = lib.nixosSystem {
inherit system;
specialArgs = {

View file

@ -13,6 +13,7 @@ let
commandline_only_hosts = [
"Alaska"
"NicksNixWSL"
];
install_packages = with pkgs; [
@ -85,26 +86,28 @@ let
# Drawing tablet driver
opentabletdriver
];
filterNulls = list: builtins.filter (x: x != null) list;
in
{
imports = [
imports = filterNulls [
./modules/atuin.nix
./modules/discord.nix
#./modules/emacs.nix
./modules/fusuma.nix
./modules/git.nix
./modules/hyprland
./modules/kitty.nix
./modules/neovim.nix
./modules/rofi.nix
./modules/tmux.nix
./modules/wezterm.nix
./modules/xdg.nix
./modules/yazi.nix
./modules/zsh.nix
(if (! builtins.elem osConfig.networking.hostName commandline_only_hosts ) then ./modules/hyprland else null)
(if (! builtins.elem osConfig.networking.hostName commandline_only_hosts ) then ../modules/discord.nix else null)
#./modules/emacs.nix
(if (! builtins.elem osConfig.networking.hostName commandline_only_hosts ) then ../modules/fusuma.nix else null)
(if (! builtins.elem osConfig.networking.hostName commandline_only_hosts ) then ../modules/rofi.nix else null)
(if (! builtins.elem osConfig.networking.hostName commandline_only_hosts ) then ../modules/kitty.nix else null)
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

13
hosts/WSL/default.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
let
in
{
# See https://nix-community.github.io/NixOS-WSL/how-to/change-username.html
# to reset default WSL login
environment = {
shells = [
"/etc/profiles/per-user/nixolas/bin/zsh"
];
};
}