mirror of
https://github.com/thiloho/nixos-config.git
synced 2025-11-22 11:31:36 +01:00
Add WSL host
This commit is contained in:
72
flake.lock
generated
72
flake.lock
generated
@@ -1,5 +1,27 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"NixOS-WSL": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1690553050,
|
||||||
|
"narHash": "sha256-pK3kF30OykL3v6P8UP6ipihlS34KoGq9SryCj3tHrFw=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"rev": "f7a95a37306c46b42e9ce751977c44c752fd5eca",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"aurora-blog-template": {
|
"aurora-blog-template": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
@@ -18,6 +40,40 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673956053,
|
||||||
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689068808,
|
||||||
|
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -71,12 +127,28 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"NixOS-WSL": "NixOS-WSL",
|
||||||
"aurora-blog-template": "aurora-blog-template",
|
"aurora-blog-template": "aurora-blog-template",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"website": "website"
|
"website": "website"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"website": {
|
"website": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|||||||
14
flake.nix
14
flake.nix
@@ -3,22 +3,29 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
home-manager = {
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
website = {
|
website = {
|
||||||
url = "github:thiloho/website";
|
url = "github:thiloho/website";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
aurora-blog-template.url = "github:thiloho/aurora";
|
aurora-blog-template.url = "github:thiloho/aurora";
|
||||||
|
NixOS-WSL = {
|
||||||
|
url = "github:nix-community/NixOS-WSL";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
outputs = inputs@{ nixpkgs, home-manager, NixOS-WSL, ... }: {
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
mkSystem = entrypoint: nixpkgs.lib.nixosSystem {
|
mkSystem = entrypoint: nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
entrypoint
|
entrypoint
|
||||||
|
(if entrypoint == ./nixos-configurations/wsl then NixOS-WSL.nixosModules.wsl else "")
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
@@ -32,6 +39,7 @@
|
|||||||
pc = mkSystem ./nixos-configurations/pc;
|
pc = mkSystem ./nixos-configurations/pc;
|
||||||
laptop = mkSystem ./nixos-configurations/laptop;
|
laptop = mkSystem ./nixos-configurations/laptop;
|
||||||
server = mkSystem ./nixos-configurations/server;
|
server = mkSystem ./nixos-configurations/server;
|
||||||
|
wsl = mkSystem ./nixos-configurations/wsl;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
61
nixos-configurations/wsl/default.nix
Normal file
61
nixos-configurations/wsl/default.nix
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{ lib, pkgs, config, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
wsl = {
|
||||||
|
enable = true;
|
||||||
|
wslConf.automount.root = "/mnt";
|
||||||
|
defaultUser = "thiloho";
|
||||||
|
startMenuLaunchers = true;
|
||||||
|
nativeSystemd = true;
|
||||||
|
|
||||||
|
# Enable native Docker support
|
||||||
|
# docker-native.enable = true;
|
||||||
|
|
||||||
|
# Enable integration with Docker Desktop (needs to be installed)
|
||||||
|
# docker-desktop.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "ThilosPC";
|
||||||
|
|
||||||
|
users.users.thiloho.isNormalUser = true;
|
||||||
|
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
pinentryFlavor = "gnome3";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.thiloho = { pkgs, lib, config, ... }: {
|
||||||
|
programs = {
|
||||||
|
helix = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
settings.theme = "ayu_dark";
|
||||||
|
};
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "thiloho";
|
||||||
|
userEmail = "123883702+thiloho@users.noreply.github.com";
|
||||||
|
signing = {
|
||||||
|
signByDefault = true;
|
||||||
|
key = "68E9DB8C7055C97A";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
stateVersion = "23.05";
|
||||||
|
packages = with pkgs; [ wget ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Enable nix flakes
|
||||||
|
nix.package = pkgs.nixFlakes;
|
||||||
|
nix.extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
|
||||||
|
system.stateVersion = "23.05";
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user