diff options
| author | K900 <me@0upti.me> | 2023-10-02 09:10:45 +0300 |
|---|---|---|
| committer | K900 <me@0upti.me> | 2023-10-02 09:23:00 +0300 |
| commit | 83d3356e5c0becc6b7ab0429b4fe6a5f3d2dbb6b (patch) | |
| tree | c387344ae04f304f72a8212ca8fecf420493169d /flake.nix | |
| parent | cadde47d123d1a534c272b04a7582f1d11474c48 (diff) | |
feat: add welcome message
Direct people to upgrade their systems first and link to support channels just in case.
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 82 |
1 files changed, 44 insertions, 38 deletions
@@ -26,49 +26,55 @@ }; nixosModules.default = self.nixosModules.wsl; - nixosConfigurations = { - modern = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - self.nixosModules.default - { wsl.enable = true; } - ]; - }; + nixosConfigurations = + let + initialConfig = { + wsl.enable = true; - legacy = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - self.nixosModules.default - { - wsl.enable = true; - wsl.nativeSystemd = false; - } - ]; - }; + programs.bash.loginShellInit = "nixos-wsl-welcome"; + }; + in + { + modern = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.default + initialConfig + ]; + }; + + legacy = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.default + initialConfig + { wsl.nativeSystemd = false; } + ]; + }; - test = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - self.nixosModules.default - ({ config, pkgs, ... }: { - wsl.enable = true; - wsl.nativeSystemd = false; + test = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.default + ({ config, pkgs, ... }: { + wsl.enable = true; + wsl.nativeSystemd = false; - system.activationScripts.create-test-entrypoint.text = - let - syschdemdProxy = pkgs.writeShellScript "syschdemd-proxy" '' - shell=$(${pkgs.glibc.bin}/bin/getent passwd root | ${pkgs.coreutils}/bin/cut -d: -f7) - exec $shell $@ + system.activationScripts.create-test-entrypoint.text = + let + syschdemdProxy = pkgs.writeShellScript "syschdemd-proxy" '' + shell=$(${pkgs.glibc.bin}/bin/getent passwd root | ${pkgs.coreutils}/bin/cut -d: -f7) + exec $shell $@ + ''; + in + '' + mkdir -p /bin + ln -sfn ${syschdemdProxy} /bin/syschdemd ''; - in - '' - mkdir -p /bin - ln -sfn ${syschdemdProxy} /bin/syschdemd - ''; - }) - ]; + }) + ]; + }; }; - }; } // flake-utils.lib.eachSystem |
