From aaf1156678024c74424256e5293f3a4d15c113b6 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Sun, 20 Aug 2023 11:23:21 +0000 Subject: [PATCH] [NixOS] Make WSL work --- nixos/bootstrap/flake.nix | 41 +++++++++++++++++++++++++++++-- nixos/machines/jay-lenovo-wsl.nix | 4 ++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/nixos/bootstrap/flake.nix b/nixos/bootstrap/flake.nix index 4d34487e..92d74214 100644 --- a/nixos/bootstrap/flake.nix +++ b/nixos/bootstrap/flake.nix @@ -25,6 +25,38 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nixos-wsl = { url = github:nix-community/NixOS-WSL; }; + + taffybar = { + url = "github:taffybar/taffybar"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + git-ignore-nix.follows = "git-ignore-nix"; + xmonad.follows = "xmonad"; + }; + }; + + xmonad = { + url = "github:xmonad/xmonad"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + git-ignore-nix.follows = "git-ignore-nix"; + }; + }; + + xmonad-contrib = { + url = "github:xmonad/xmonad-contrib"; + }; + + notifications-tray-icon = { + url = "github:IvanMalison/notifications-tray-icon"; + inputs.flake-utils.follows = "flake-utils"; + inputs.git-ignore-nix.follows = "git-ignore-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixified-ai = { url = "github:nixified-ai/flake"; }; }; outputs = inputs@{ @@ -42,8 +74,13 @@ nixpkgs.lib.nixosSystem (args // { inherit system; modules = baseModules ++ modules; - specialArgs = { inherit inputs; } // specialArgs; - makeEnable = (import ../make-enable.nix) nixpkgs.lib; + specialArgs = rec { + inherit inputs; + makeEnable = (import ../make-enable.nix) nixpkgs.lib; + mapValueToKeys = keys: value: builtins.listToAttrs (map (name: { inherit name value; }) keys); + realUsers = [ "root" "imalison" "kat" "dean" "alex" ]; + forEachUser = mapValueToKeys realUsers; + } // specialArgs; }); machinesPath = ../machines; machineFilenames = builtins.attrNames (builtins.readDir machinesPath); diff --git a/nixos/machines/jay-lenovo-wsl.nix b/nixos/machines/jay-lenovo-wsl.nix index a57ea56d..1a448608 100644 --- a/nixos/machines/jay-lenovo-wsl.nix +++ b/nixos/machines/jay-lenovo-wsl.nix @@ -4,7 +4,9 @@ ../configuration.nix ]; - modules.wls.enable = true;tworking.hostName = "jay-lenovo-wsl"; + modules.wsl.enable = true; + + networking.hostName = "jay-lenovo-wsl"; wsl.defaultUser = "kat"; system.stateVersion = "22.05";