NixOS on WSL updates

This commit is contained in:
Greg Hellings
2022-12-24 00:36:36 -06:00
parent 75b1f637a0
commit 50238c7fba
9 changed files with 124 additions and 87 deletions
+32 -8
View File
@@ -11,7 +11,11 @@ let
if username == "root" then "/root" else
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "/Users/${username}" else "/home/${username}" );
mkhome = system: gui:
mkhome = {
system,
gui,
gnome
}:
let
homeDirectory = home system;
@@ -26,15 +30,35 @@ let
in home-manager.lib.homeManagerConfiguration rec {
inherit pkgs system username homeDirectory;
stateVersion = "22.05";
configuration = import ./home.nix username {
inherit pkgs gui;
configuration = import ./home.nix {
inherit pkgs gui gnome;
inherit (pkgs) config lib stdenv;
};
};
gdm = {
gui = true;
gnome = true;
};
cli = {
gui = false;
gnome = false;
};
gui = {
gui = true;
gnome = false;
};
arch = { system = "aarch64-linux"; };
x86 = { system = "x86_64-linux"; };
darwin = { system = "x86_64-darwin"; };
in {
"aarch64-gui" = mkhome "aarch64-linux" true;
"aarch64-nogui" = mkhome "aarch64-linux" false;
"x86_64-gui" = mkhome "x86_64-linux" true;
"x86_64-nogui" = mkhome "x86_64-linux" false;
"x86_64-darwin" = mkhome "x86_64-darwin" true;
"wsl" = mkhome (gui // arch);
"aarch64-gui" = mkhome (gdm // arch);
"aarch64-nogui" = mkhome (cli // arch);
"x86_64-gui" = mkhome (gdm // x86);
"x86_64-nogui" = mkhome (cli // x86);
"x86_64-darwin" = mkhome (gdm // darwin);
}
+13 -5
View File
@@ -1,10 +1,18 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; ( if ( lib.hasSuffix "-darwin" pkgs.system) then
[] else
[
let
darwinPkgs = [];
x86Pkgs = with pkgs; [
element-desktop
slack
]);
];
archPkgs = with pkgs; [
element-desktop
];
in {
home.packages = ( if ( pkgs.stdenv.hostPlatform.isDarwin ) then darwinPkgs else
( if ( lib.hasPrefix "aarch64" pkgs.system ) then archPkgs else
( if ( lib.hasPrefix "x86_64" pkgs.system ) then x86Pkgs else [] )
)
);
}
+8 -7
View File
@@ -3,15 +3,12 @@
{
imports = [
./chat.nix
./gnome.nix
./firefox.nix
./terminal.nix
];
home.packages = with pkgs; [
bazel
bazel-buildtools
bitwarden
cargo # Rustc
cdrtools
ffmpeg
@@ -22,15 +19,19 @@
handbrake
jdk11
libtheora
onlyoffice-bin
synology-drive-client
vlc
x265
zoom-us
] ++ ( if pkgs.system != "x86_64-darwin" then
] ++ ( if ( pkgs.system != "x86_64-darwin" && pkgs.system != "aarch64-linux" ) then
[
jellyfin-media-player
nextcloud-client
] else []
) ++ ( if ( pkgs.system != "aarch64-linux" ) then
[
bitwarden
onlyoffice-bin
synology-drive-client
zoom-us
] else []
);
}
-47
View File
@@ -1,47 +0,0 @@
{ pkgs, lib, ... }:
let
gv = lib.hm.gvariant;
in {
dconf.settings = lib.mkIf ( lib.hasSuffix "-linux" pkgs.system ) {
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [];
switch-applications-backward = [];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Console.desktop"
"firefox.desktop"
"vlc.desktop"
];
};
"org/gnome/shell/overrides" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu://session" "qemu://system" ];
uris = [ "qemu://session" "qemu://system" ];
};
};
}
-13
View File
@@ -1,13 +0,0 @@
{ lib, pkgs, ... }:
{
programs.gnome-terminal = lib.mkIf ( pkgs.system != "x86_64-darwin") {
enable = true;
showMenubar = true;
themeVariant = "dark";
profile.default = {
default = true;
visibleName = "greg";
};
};
}
+5 -7
View File
@@ -1,10 +1,6 @@
name: { pkgs, lib, gui, config, ...}:
{ pkgs, lib, gui, gnome, ...}:
let
guiImports = if gui then
[ ./gui ] else [];
in {
{
imports = [
./modules
./ansible.nix
@@ -15,9 +11,11 @@ in {
./templates.nix
./vim.nix
./xonsh.nix
] ++ guiImports;
] ++ ( if gui then [ ./gui ] else []);
greg.gnome = gnome;
programs.tmux = {
enable = true;
keyMode = "vi";
+1
View File
@@ -2,6 +2,7 @@
{
imports = [
./gnome.nix
./xonsh.nix
];
}
+62
View File
@@ -0,0 +1,62 @@
{ config, pkgs, lib, ... }:
let
gv = lib.hm.gvariant;
cfg = config.greg.gnome;
in {
options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings";
config = (lib.mkIf cfg {
programs.gnome-terminal = lib.mkIf ( pkgs.system != "x86_64-darwin") {
enable = true;
showMenubar = true;
themeVariant = "dark";
profile.default = {
default = true;
visibleName = "greg";
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [];
switch-applications-backward = [];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Console.desktop"
"firefox.desktop"
"vlc.desktop"
];
};
"org/gnome/shell/overrides" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu://session" "qemu://system" ];
uris = [ "qemu://session" "qemu://system" ];
};
};
});
}
+3
View File
@@ -7,6 +7,9 @@ if [ "$(uname -s)" == "Darwin" ]; then
# On macOS
src="${HOME}/.config/nix/"
target="${arch}-darwin"
elif [ x"${WSL_DISTRO_NAME}" != "x" ]; then
src=/etc/nixos
target="wsl"
else
# On Linux/WSL2 systems
if [ -z "${DISPLAY}" ]; then