mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-05-19 02:46:06 -07:00
basic wsl config
This commit is contained in:
parent
dbb35cecf3
commit
07ab279d00
72
provision/flake.lock
generated
72
provision/flake.lock
generated
@ -43,6 +43,40 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"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-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726560853,
|
||||||
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -101,6 +135,28 @@
|
|||||||
"url": "https://github.com/Jovian-Experiments/Jovian-NixOS"
|
"url": "https://github.com/Jovian-Experiments/Jovian-NixOS"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixos-wsl": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1727464323,
|
||||||
|
"narHash": "sha256-XhiLvnM95aNpRm3qJ9hsVV/prin4GVapn4snMN4Ol6k=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"rev": "4aef94d5afb4a791e5e9a3ee844c68ad01f54a14",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703013332,
|
"lastModified": 1703013332,
|
||||||
@ -138,6 +194,7 @@
|
|||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"jovian-nixos": "jovian-nixos",
|
"jovian-nixos": "jovian-nixos",
|
||||||
|
"nixos-wsl": "nixos-wsl",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -155,6 +212,21 @@
|
|||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
@ -8,9 +8,11 @@
|
|||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
jovian-nixos.url = "git+https://github.com/Jovian-Experiments/Jovian-NixOS?ref=development";
|
jovian-nixos.url = "git+https://github.com/Jovian-Experiments/Jovian-NixOS?ref=development";
|
||||||
jovian-nixos.flake = false;
|
jovian-nixos.flake = false;
|
||||||
|
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
||||||
|
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ { self, nixpkgs, home-manager, jovian-nixos, agenix, ... }:
|
outputs = inputs @ { self, nixpkgs, home-manager, jovian-nixos, agenix, nixos-wsl, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
user = "tstarr";
|
user = "tstarr";
|
||||||
@ -33,6 +35,10 @@
|
|||||||
inherit lib;
|
inherit lib;
|
||||||
inherit system user inputs agenix home-manager jovian-nixos;
|
inherit system user inputs agenix home-manager jovian-nixos;
|
||||||
});
|
});
|
||||||
|
wsl = lib.nixosSystem (import ./hosts/wsl {
|
||||||
|
inherit lib;
|
||||||
|
inherit system user inputs agenix home-manager nixos-wsl;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
57
provision/hosts/wsl/configuration.nix
Normal file
57
provision/hosts/wsl/configuration.nix
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
{ config, pkgs, user, lib, inputs, nixos-wsl, ... }:
|
||||||
|
let
|
||||||
|
defaultUser = user;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
nixos-wsl.nixosModules.wsl
|
||||||
|
];
|
||||||
|
|
||||||
|
wsl = {
|
||||||
|
inherit defaultUser;
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
wslConf.automount.root = "/mnt";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set networking options
|
||||||
|
networking.hostName = "wsl";
|
||||||
|
networking.firewall.checkReversePath = "loose";
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
boot.isContainer = true;
|
||||||
|
|
||||||
|
# configure root
|
||||||
|
users.users.root = {
|
||||||
|
extraGroups = [ "root" ];
|
||||||
|
};
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
# Disable systemd units that don't make sense on WSL
|
||||||
|
systemd.services."serial-getty@ttyS0".enable = false;
|
||||||
|
systemd.services."serial-getty@hvc0".enable = false;
|
||||||
|
systemd.services."getty@tty1".enable = false;
|
||||||
|
systemd.services."autovt@".enable = false;
|
||||||
|
|
||||||
|
systemd.services.firewall.enable = false;
|
||||||
|
systemd.services.systemd-resolved.enable = false;
|
||||||
|
systemd.services.systemd-udevd.enable = false;
|
||||||
|
|
||||||
|
# Don't allow emergency mode, because we don't have a console.
|
||||||
|
systemd.enableEmergencyMode = false;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
modules = {
|
||||||
|
devel = {
|
||||||
|
python.enable = true;
|
||||||
|
tooling.enable = true;
|
||||||
|
};
|
||||||
|
system = {
|
||||||
|
ssh.enable = true;
|
||||||
|
terminal.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
provision/hosts/wsl/default.nix
Normal file
21
provision/hosts/wsl/default.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ lib, system, user, inputs, agenix, home-manager, nixos-wsl, ... }:
|
||||||
|
{
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit user inputs nixos-wsl; };
|
||||||
|
modules = [
|
||||||
|
../default # shared by all configs
|
||||||
|
./configuration.nix # wsl specific
|
||||||
|
../../modules
|
||||||
|
agenix.nixosModules.default
|
||||||
|
home-manager.nixosModules.home-manager {
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.extraSpecialArgs = { inherit user; };
|
||||||
|
home-manager.users.${user} = {
|
||||||
|
imports = [
|
||||||
|
../../home-modules
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user