diff --git a/_hosts/caesium-wsl/configuration.nix b/_hosts/caesium-wsl/configuration.nix new file mode 100644 index 0000000..b439f56 --- /dev/null +++ b/_hosts/caesium-wsl/configuration.nix @@ -0,0 +1,59 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://github.com/nix-community/NixOS-WSL + +{ config, lib, pkgs, ... }: + +{ + imports = [ + + ]; + + environment.systemPackages = with pkgs; [ + git + wget + ]; + + programs.zsh = { + enable = true; + enableCompletion = true; + # autosuggestion.enable = true; + syntaxHighlighting.enable = true; + shellAliases = { + ll = "ls -l"; + update = "sudo nixos-rebuild switch --flake ~/nixos#caesium-wsl"; + laws = "aws --endpoint=http://localhost:8081"; + dev = "nix develop -c $SHELL"; + nixos = "code ~/nixos"; + }; + histSize = 10000; + ohMyZsh = { + enable = true; + plugins = [ "git" ]; + theme = "robbyrussell"; + }; + }; + + programs.nix-ld = { + enable = true; + package = pkgs.nix-ld-rs; # only for NixOS 24.05 + }; + + users.defaultUserShell = pkgs.zsh; + + wsl.enable = true; + wsl.defaultUser = "nixos"; + + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/flake.lock b/flake.lock index 46fde84..c46f4db 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1721463311, - "narHash": "sha256-zmvqafJogm5DJ8+2v/kE9Oj8AGzK7IBOdMSIPZyKuNk=", + "lastModified": 1742097805, + "narHash": "sha256-N3/7llBZ93Itf7ndnNtEm7lPoMqSC57B/PNaMB6cL1Q=", "owner": "rycee", "repo": "nur-expressions", - "rev": "863eb5594f8c375d1ddaa2cea84a819c5197dd76", + "rev": "5a0ac85616aa6b166ea715a41bc1255bb802b189", "type": "gitlab" }, "original": { @@ -23,6 +23,22 @@ "type": "gitlab" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1629284811, @@ -63,11 +79,11 @@ ] }, "locked": { - "lastModified": 1721534365, - "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", + "lastModified": 1741955947, + "narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=", "owner": "nix-community", "repo": "home-manager", - "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", + "rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4", "type": "github" }, "original": { @@ -78,11 +94,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1721413321, - "narHash": "sha256-0GdiQScDceUrVGbxYpV819LHesK3szHOhJ09e6sgES4=", + "lastModified": 1741792691, + "narHash": "sha256-f0BVt1/cvA0DQ/q3rB+HY4g4tKksd03ZkzI4xehC2Ew=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ab165a8a6cd12781d76fe9cbccb9e975d0fb634f", + "rev": "e1f12151258b12c567f456d8248e4694e9390613", "type": "github" }, "original": { @@ -92,13 +108,49 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1741870048, + "narHash": "sha256-odXRdNZGdXg1LmwlAeWL85kgy/FVHsgKlDwrvbR2BsU=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "5d76001e33ee19644a598ad80e7318ab0957b122", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1721379653, - "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "lastModified": 1740865531, + "narHash": "sha256-h00vGIh/jxcGl8aWdfnVRD74KuLpyY3mZgMFMy7iKIc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ef6c425980847c78a80d759abc476e941a9bf42", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1741851582, + "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", "type": "github" }, "original": { @@ -113,7 +165,8 @@ "firefox-addons": "firefox-addons", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_2", "vscode-server": "vscode-server" } }, @@ -140,11 +193,11 @@ ] }, "locked": { - "lastModified": 1713958148, - "narHash": "sha256-8PDNi/dgoI2kyM7uSiU4eoLBqUKoA+3TXuz+VWmuCOc=", + "lastModified": 1729422940, + "narHash": "sha256-DlvJv33ml5UTKgu4b0HauOfFIoDx6QXtbqUF3vWeRCY=", "owner": "nix-community", "repo": "nixos-vscode-server", - "rev": "fc900c16efc6a5ed972fb6be87df018bcf3035bc", + "rev": "8b6db451de46ecf9b4ab3d01ef76e59957ff549f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 67c3cb3..32c3f54 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; vscode-server = { url = "github:nix-community/nixos-vscode-server"; @@ -19,9 +20,10 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; + }; - outputs = { self, nixpkgs, nixos-hardware, ... }@inputs: + outputs = { self, nixpkgs, nixos-hardware, nixos-wsl, ... }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { @@ -63,6 +65,15 @@ ]; }; + nixosConfigurations.caesium-wsl = nixpkgs.lib.nixosSystem { + specialArgs = { inherit system; inherit inputs; }; + + modules = [ + nixos-wsl.nixosModules.default + ./_hosts/caesium-wsl/configuration.nix + ]; + }; + homeManagerModules.default = "./nixos-modules/home-manager"; }; }