diff options
| author | nzbr <mail@nzbr.de> | 2023-10-02 11:41:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-02 11:41:50 +0200 |
| commit | 337edef90c8abe35b42e95aecf510a063dad02dd (patch) | |
| tree | 2c96628395596ece620fd0ac722ca941bee5fb6d /flake.nix | |
| parent | 46d35ee9d3bd9fa3b31c3b660248db7c84d90555 (diff) | |
| parent | 83d3356e5c0becc6b7ab0429b4fe6a5f3d2dbb6b (diff) | |
Merge pull request #303 from nix-community/welcome
feat: add welcome message
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 |
