feat: slim down wsl install

This commit is contained in:
winston 2024-02-23 10:13:54 +01:00
parent a68e0ca317
commit 48c895adae
Signed by: winston
GPG key ID: 3786770EDBC2B481
9 changed files with 166 additions and 174 deletions

View file

@ -2,12 +2,19 @@
"nodes": { "nodes": {
"agenix": { "agenix": {
"inputs": { "inputs": {
"darwin": "darwin", "darwin": [
"home-manager": "home-manager", "darwin"
],
"home-manager": [
"home-manager"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems" "systems": [
"flake-utils",
"systems"
]
}, },
"locked": { "locked": {
"lastModified": 1707830867, "lastModified": 1707830867,
@ -66,37 +73,15 @@
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"agenix",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1700795494, "lastModified": 1708231718,
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", "narHash": "sha256-IZdieFWvhBkxoOFMDejqLUYqD94WN6k0YSpw0DFy+4g=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", "rev": "0e6857fa1d632637488666c08e7b02c08e3178f8",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"darwin_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1707707289,
"narHash": "sha256-YuDt/eSTXMEHv8jS8BEZJgqCcG8Tr3cyqaZjJFXZHsw=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "44f50a5ecaab72a61d5fd8e5c5717bc4bf9c25dd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -107,7 +92,9 @@
}, },
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1706830856, "lastModified": 1706830856,
@ -125,7 +112,7 @@
}, },
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1705309234,
@ -143,7 +130,7 @@
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1705309234,
@ -183,36 +170,15 @@
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"agenix",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1703113217, "lastModified": 1708591310,
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", "narHash": "sha256-8mQGVs8JccWTnORgoLOTh9zvf6Np+x2JzhIc+LDcJ9s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", "rev": "0e0e9669547e45ea6cca2de4044c1a384fd0fe55",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1707919853,
"narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "043ba285c6dc20f36441d48525402bcb9743c498",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -228,11 +194,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1707894220, "lastModified": 1708585389,
"narHash": "sha256-jHIV2jjNIG+w3pAnjoOEFxHCHZ2vP2c1YZLtXstLqQQ=", "narHash": "sha256-CtKgXtHjOWAJQF7FF2XJFcVwKH0A0xE1xj1GnHGf7UI=",
"owner": "nekowinston", "owner": "nekowinston",
"repo": "nur", "repo": "nur",
"rev": "0d91a010e4ee989765ec849e8a3df74554d887a6", "rev": "10b5d3f61ab8d6bb1bf236b183800fccaa7a3a78",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -248,11 +214,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707620986, "lastModified": 1708225687,
"narHash": "sha256-XE0tCSkSVBeJDWhjFwusNInwAhrnp+TloUNUpvnTiLw=", "narHash": "sha256-NJBDfvknI26beOFmjO2coeJMTTUCCtw2Iu+rvJ1Zb9k=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "0cb4345704123492e6d1f1068629069413c80de0", "rev": "17352eb241a8d158c4ac523b19d8d2a6c8efe127",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -272,11 +238,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707959659, "lastModified": 1708564557,
"narHash": "sha256-bZmLqeoa6M9Dhx5WKpBYExhoy4mrW4FSDWBTxBnVaBg=", "narHash": "sha256-aG1OY88ntSeoLbS8+mAqU/m8rMC2q5tfmGFdLRYjzOs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "f7483e526e4fc42b979d652d8e43bfd6204924c0", "rev": "8b06e691e817a0de06bd22f610e778937ab7ade0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,11 +253,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1707268954, "lastModified": 1708118438,
"narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -301,31 +267,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1706550542,
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1707863367, "lastModified": 1708475490,
"narHash": "sha256-LdBbCSSP7VHaHA4KXcPGKqkvsowT2+7W4jlEHJj6rPg=", "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "35ff7e87ee05199a8003f438ec11a174bcbd98ea", "rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -337,11 +285,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1707995185, "lastModified": 1708597774,
"narHash": "sha256-EZEloWq14yCTy3X6uBOTDxgC4bIKUcxzVfdKnfQau/0=", "narHash": "sha256-dofnVMqnuLFiVUGl5l3J27byhnWehd3QvFhLZWczqBc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nur", "repo": "nur",
"rev": "b49255739b185560e4025ed905b76e12bd73ba40", "rev": "f2af010f46a7eb25cbeef01f6942eb3b14fbd1da",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -365,11 +313,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707297608, "lastModified": 1708018599,
"narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "0db2e67ee49910adfa13010e7f012149660af7f0", "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -383,10 +331,10 @@
"agenix": "agenix", "agenix": "agenix",
"caarlos0-nur": "caarlos0-nur", "caarlos0-nur": "caarlos0-nur",
"catppuccin-vsc": "catppuccin-vsc", "catppuccin-vsc": "catppuccin-vsc",
"darwin": "darwin_2", "darwin": "darwin",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager_2", "home-manager": "home-manager",
"nekowinston-nur": "nekowinston-nur", "nekowinston-nur": "nekowinston-nur",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-vscode-extensions": "nix-vscode-extensions", "nix-vscode-extensions": "nix-vscode-extensions",
@ -394,6 +342,7 @@
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"swayfx": "swayfx", "swayfx": "swayfx",
"vscode-server": "vscode-server",
"wsl": "wsl" "wsl": "wsl"
} }
}, },
@ -409,11 +358,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707617562, "lastModified": 1708231627,
"narHash": "sha256-Kk2vv5e4MqKPjelKoYsa6YaUyv3pvjWY9nJSnP2QU9w=", "narHash": "sha256-beDYL9tOe1pw1kLChFbSSSl5wM81rat6t96baqG4+xM=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "a22bbbee9b479c6d95b4819135e856a6d447b3ba", "rev": "5d4170f50065cb04cef941831786a50637c4e20b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -473,18 +422,26 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": { "vscode-server": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1684517665,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=",
"owner": "nix-systems", "owner": "nix-community",
"repo": "default", "repo": "nixos-vscode-server",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-community",
"repo": "default", "repo": "nixos-vscode-server",
"type": "github" "type": "github"
} }
}, },
@ -499,11 +456,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707761607, "lastModified": 1708331102,
"narHash": "sha256-OKNdTgnyhZpmqdgba8s78/QvowyTIMJDp0iLxv570bU=", "narHash": "sha256-nTOiQvmbB9HtxeTWgXdd2FH2w3cOyOIIrPUm+YtDVyY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-wsl", "repo": "nixos-wsl",
"rev": "c8ddba82ca6b791be1acaae4b336ff8e857ec70b", "rev": "e6bbc01a35626b8db741bcbc0af807379d372218",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -132,26 +132,38 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
agenix = {
url = "github:ryantm/agenix";
inputs.darwin.follows = "darwin";
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "flake-utils/systems";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions = { nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions"; url = "github:nix-community/nix-vscode-extensions";
inputs.flake-compat.follows = ""; inputs.flake-compat.follows = "";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
swayfx = { swayfx = {
url = "github:willpower3309/swayfx"; url = "github:willpower3309/swayfx";
inputs.flake-compat.follows = ""; inputs.flake-compat.follows = "";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = { pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix"; url = "github:cachix/pre-commit-hooks.nix";

View file

@ -1,5 +1,7 @@
{ {
config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: let }: let
@ -7,55 +9,57 @@
secondary-color = "#161321"; secondary-color = "#161321";
wallpaper-uri = "file://${../wallpapers/dhm_1610.png}"; wallpaper-uri = "file://${../wallpapers/dhm_1610.png}";
in { in {
home.packages = with pkgs.gnomeExtensions; [ config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "gnome")) {
appindicator home.packages = with pkgs.gnomeExtensions; [
blur-my-shell appindicator
mullvad-indicator blur-my-shell
noannoyance-fork mullvad-indicator
pop-shell noannoyance-fork
user-themes pop-shell
]; user-themes
];
dconf.settings = with lib.hm.gvariant; { dconf.settings = with lib.hm.gvariant; {
# input # input
"org/gnome/desktop/wm/preferences" = { "org/gnome/desktop/wm/preferences" = {
resize-with-right-button = true; resize-with-right-button = true;
}; };
"org/gnome/desktop/input-sources" = { "org/gnome/desktop/input-sources" = {
sources = [(mkTuple ["xkb" "us"])]; sources = [(mkTuple ["xkb" "us"])];
xkb-options = ["caps:ctrl_modifier"]; xkb-options = ["caps:ctrl_modifier"];
}; };
# rice # rice
"org/gnome/shell" = { "org/gnome/shell" = {
disable-user-extensions = false; disable-user-extensions = false;
enabled-extensions = [ enabled-extensions = [
"appindicatorsupport@rgcjonas.gmail.com" "appindicatorsupport@rgcjonas.gmail.com"
"blur-my-shell@aunetx" "blur-my-shell@aunetx"
"drive-menu@gnome-shell-extensions.gcampax.github.com" "drive-menu@gnome-shell-extensions.gcampax.github.com"
"mullvadindicator@pobega.github.com" "mullvadindicator@pobega.github.com"
"noannoyance-fork@vrba.dev" "noannoyance-fork@vrba.dev"
"user-theme@gnome-shell-extensions.gcampax.github.com" "user-theme@gnome-shell-extensions.gcampax.github.com"
]; ];
favorite-apps = ["org.gnome.Nautilus.desktop" "chromium-browser.desktop" "org.wezfurlong.wezterm.desktop"]; favorite-apps = ["org.gnome.Nautilus.desktop" "chromium-browser.desktop" "org.wezfurlong.wezterm.desktop"];
}; };
"org/gnome/shell/extensions/user-theme" = { "org/gnome/shell/extensions/user-theme" = {
name = "Catppuccin-Frappe-Compact-Pink-Dark"; name = "Catppuccin-Frappe-Compact-Pink-Dark";
}; };
# wallpaper # wallpaper
"org/gnome/desktop/background" = { "org/gnome/desktop/background" = {
color-shading-type = "solid"; color-shading-type = "solid";
picture-options = "zoom"; picture-options = "zoom";
picture-uri = wallpaper-uri; picture-uri = wallpaper-uri;
picture-uri-dark = wallpaper-uri; picture-uri-dark = wallpaper-uri;
inherit primary-color secondary-color; inherit primary-color secondary-color;
}; };
"org/gnome/desktop/screensaver" = { "org/gnome/desktop/screensaver" = {
color-shading-type = "solid"; color-shading-type = "solid";
picture-options = "zoom"; picture-options = "zoom";
picture-uri = wallpaper-uri; picture-uri = wallpaper-uri;
inherit primary-color secondary-color; inherit primary-color secondary-color;
};
}; };
}; };
} }

View file

@ -3,6 +3,7 @@
flakePath, flakePath,
lib, lib,
pkgs, pkgs,
isNixOS,
... ...
}: let }: let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
@ -132,4 +133,10 @@ in {
}; };
}; };
xdg.mimeApps.defaultApplications."text/plain" = "code.desktop"; xdg.mimeApps.defaultApplications."text/plain" = "code.desktop";
services.vscode-server = {
# when using a non-nixOS system, there's no need to patch the server
enable = isNixOS;
nodejsPackage = pkgs.nodejs_18;
};
} }

View file

@ -11,7 +11,7 @@
if isDarwin if isDarwin
then "/Users/${username}/.config/flake" then "/Users/${username}/.config/flake"
else "/home/${username}/.config/flake"; else "/home/${username}/.config/flake";
inherit inputs; inherit inputs isNixOS;
}; };
hmStandaloneConfig = { hmStandaloneConfig = {
@ -33,6 +33,7 @@
caarlos0-nur.homeManagerModules.default caarlos0-nur.homeManagerModules.default
nekowinston-nur.homeManagerModules.default nekowinston-nur.homeManagerModules.default
nix-index-database.hmModules.nix-index nix-index-database.hmModules.nix-index
vscode-server.homeModules.default
]) ])
++ [ ++ [
({ ({

View file

@ -1,4 +1,9 @@
{pkgs, ...}: { {
config,
lib,
pkgs,
...
}: {
services = { services = {
dnsmasq = { dnsmasq = {
enable = true; enable = true;
@ -17,7 +22,7 @@
}; };
mullvad-vpn = { mullvad-vpn = {
enable = true; enable = true;
package = pkgs.mullvad-vpn; package = lib.mkIf config.isGraphical pkgs.mullvad-vpn;
}; };
stubby = { stubby = {
enable = true; enable = true;

View file

@ -1,9 +1,9 @@
{ {config, ...}: {
programs.noisetorch.enable = true; programs.noisetorch.enable = config.isGraphical;
security.rtkit.enable = true; security.rtkit.enable = true;
services = { services = {
pipewire = { pipewire = {
enable = true; enable = config.isGraphical;
pulse.enable = true; pulse.enable = true;
alsa.enable = true; alsa.enable = true;
}; };

View file

@ -3,7 +3,12 @@
pkgs, pkgs,
... ...
}: { }: {
services.kanata.enable = lib.mkForce false; services = {
kanata.enable = lib.mkForce false;
dnsmasq.enable = lib.mkForce false;
mullvad-vpn.enable = lib.mkForce false;
stubby.enable = lib.mkForce false;
};
system = { system = {
build.installBootLoader = lib.mkForce "${pkgs.coreutils}/bin/true"; build.installBootLoader = lib.mkForce "${pkgs.coreutils}/bin/true";

View file

@ -45,7 +45,7 @@
in { in {
${target}."${host}" = builder { ${target}."${host}" = builder {
inherit system; inherit system;
modules = with inputs; modules =
[ [
{ {
options = { options = {
@ -56,7 +56,7 @@
description = "The username of the user"; description = "The username of the user";
}; };
desktop = mkOption { desktop = mkOption {
type = types.enum ["gnome" "sway"]; type = types.nullOr (types.enum ["gnome" "sway"]);
default = "sway"; default = "sway";
description = "The desktop environment to use"; description = "The desktop environment to use";
}; };
@ -67,12 +67,13 @@
description = "Whether the system is a graphical target"; description = "Whether the system is a graphical target";
}; };
}; };
config.dotfiles.desktop = pkgs.lib.mkIf (!isGraphical) null;
config.networking.hostName = host; config.networking.hostName = host;
} }
./common/shared ./common/shared
./common/${hostPlatform} ./common/${hostPlatform}
./${host} ./${host}
home-manager.${module}.home-manager inputs.home-manager.${module}.home-manager
] ]
++ [(hmCommonConfig {inherit username;})] ++ [(hmCommonConfig {inherit username;})]
++ extraModules; ++ extraModules;