From eb27732122a183dfa13182078fcb00f4dc8d5c44 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:57:03 +0000 Subject: [PATCH] wsl --- flake.nix | 16 ++++++++++++--- systems/wsl/configuration.nix | 38 +++++++++++++++-------------------- users/anon.nix | 1 + 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/flake.nix b/flake.nix index 4557b6f..63ef045 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,14 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, nixos-hardware, nixos-wsl, nixpkgs-unstable, agenix, home-manager }@inputs: + outputs = { self, + nixpkgs, + nixos-hardware, + nixos-wsl, + nixpkgs-unstable, + agenix, + home-manager + }@inputs: let system = "x86_64-linux"; overlay-unstable = final: prev: { @@ -41,7 +48,7 @@ ./modules/synapse.nix ./modules/nextcloud.nix - #./modules/coturn.nix + #./modules/coturn.nix ./modules/acme.nix ./modules/samba.nix @@ -70,9 +77,12 @@ ]; }; nixosConfigurations."wsl" = nixpkgs.lib.nixosSystem { - inherit system; + inherit system; specialArgs = { inherit inputs; }; modules = [ + #"${nixpkgs}/nixos/modules/profiles/minimal.nix" + ./users/anon.nix + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ./systems/wsl/configuration.nix nixos-wsl.nixosModules.default home-manager.nixosModules.home-manager diff --git a/systems/wsl/configuration.nix b/systems/wsl/configuration.nix index b3bb892..67fe07f 100644 --- a/systems/wsl/configuration.nix +++ b/systems/wsl/configuration.nix @@ -5,7 +5,7 @@ # NixOS-WSL specific options are documented on the NixOS-WSL repository: # https://github.com/nix-community/NixOS-WSL -{ config, lib, pkgs, ... } : #nixos-wsl, ... }: +{ config, lib, pkgs, inputs, ... } : #nixos-wsl, ... }: { imports = [ @@ -13,38 +13,32 @@ # ]; - wsl.enable = true; - wsl.defaultUser = "nixos"; + wsl = { + enable = true; + startMenuLaunchers = true; + wslConf = { + automount.root = "/mnt"; + interop = { enabled = false; appendWindowsPath = false;}; + }; + }; + nix.optimise.automatic = true; nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; }; nix.settings.trusted-substituters = [ "https://ai.cachix.org" ]; nix.settings.trusted-public-keys = [ "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc=" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + environment.systemPackages = with pkgs; [ - neofetch - openssh + neofetch + openssh ]; - wsl.wslConf = { - interop = { enabled = false; appendWindowsPath = false; }; - }; - networking.hostName = "wsl"; - home-manager.users.nixos = { pkgs, ... }: { - programs.bash.enable = true; - programs.git = { - enable = true; - }; - # The state version is required and should stay at the version you - # originally installed. - home.stateVersion = "23.05"; - }; - # 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 diff --git a/users/anon.nix b/users/anon.nix index b9f27af..ecf5c3e 100644 --- a/users/anon.nix +++ b/users/anon.nix @@ -9,6 +9,7 @@ }; useUserPackages = true; users.anon = { + programs.git.enable = true; programs.zsh = { enable = true; enableCompletion = true;