diff --git a/flake.lock b/flake.lock index ecbedbc..532fad2 100644 --- a/flake.lock +++ b/flake.lock @@ -69,6 +69,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs_3" @@ -340,7 +356,8 @@ "printerfacts": "printerfacts", "rhea": "rhea", "utils": "utils_3", - "waifud": "waifud" + "waifud": "waifud", + "wsl": "wsl" } }, "utils": { @@ -412,6 +429,30 @@ "type": "github" } }, + "wsl": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": [ + "utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1650629047, + "narHash": "sha256-IwiKbzXTzodPKMHm5qTizGoMVjipevbliraFmnrdsqU=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "69783cf56b2ada7e0e8cc8d17907a346e8bd97b7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NixOS-WSL", + "type": "github" + } + }, "xess": { "inputs": { "nixpkgs": "nixpkgs_6", diff --git a/flake.nix b/flake.nix index d3863fa..92b382e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,12 @@ utils.url = "github:numtide/flake-utils"; emacs-overlay.url = "github:nix-community/emacs-overlay"; + wsl = { + url = "github:nix-community/NixOS-WSL"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "utils"; + }; + # my apps printerfacts = { url = "git+https://tulpa.dev/cadey/printerfacts.git?ref=main"; @@ -32,7 +38,7 @@ }; outputs = { self, nixpkgs, deploy-rs, home-manager, agenix, printerfacts, mara - , rhea, waifud, emacs-overlay, ... }: + , rhea, waifud, emacs-overlay, wsl, ... }: let pkgs = nixpkgs.legacyPackages."x86_64-linux"; mkSystem = extraModules: @@ -50,9 +56,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; }) - ({ config, ... }: { - nixpkgs.overlays = [ emacs-overlay.overlay ]; - }) + ({ config, ... }: { nixpkgs.overlays = [ emacs-overlay.overlay ]; }) ./common printerfacts.nixosModules.${system}.printerfacts @@ -70,13 +74,95 @@ }; nixosConfigurations = { + # wsl + xatci = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModules.home-manager + wsl.nixosModules.wsl + + ({ config, ... }: { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + nixpkgs.overlays = [ emacs-overlay.overlay ]; + + networking.hostName = "xatci"; + + wsl = { + enable = true; + automountPath = "/mnt"; + defaultUser = "cadey"; + startMenuLaunchers = true; + }; + + nix.package = pkgs.nixFlakes; + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + users.users.cadey = { + extraGroups = [ + "wheel" + "docker" + "audio" + "plugdev" + "libvirtd" + "adbusers" + "dialout" + "within" + ]; + shell = pkgs.fish; + }; + + home-manager.users.cadey = { ... }: + let + name = "Xe Iaso"; + email = "me@christine.website"; + commitTemplate = pkgs.writeTextFile { + name = "cadey-commit-template"; + text = '' + Signed-off-by: ${name} <${email}> + ''; + }; + in { + imports = + [ ./common/home-manager ./common/users/cadey/spacemacs ]; + + within = { + fish.enable = true; + neofetch.enable = true; + vim.enable = true; + }; + + programs.git = { + package = pkgs.gitAndTools.gitFull; + enable = true; + userName = name; + userEmail = email; + ignores = [ "*~" "*.swp" "*.#" ]; + delta.enable = true; + extraConfig = { + commit.template = "${commitTemplate}"; + core.editor = "vim"; + color.ui = "auto"; + credential.helper = "store --file ~/.git-credentials"; + format.signoff = true; + init.defaultBranch = "main"; + protocol.keybase.allow = "always"; + pull.rebase = "true"; + push.default = "current"; + }; + }; + }; + }) + ]; + }; + # avalon chrysalis = mkSystem [ ./hosts/chrysalis ./hardware/location/YOW ]; - itsuki = mkSystem [ - ./hosts/itsuki - ./hardware/location/YOW - ]; + itsuki = mkSystem [ ./hosts/itsuki ./hardware/location/YOW ]; kos-mos = mkSystem [ ./hosts/kos-mos