Skip to content

Commit

Permalink
chore(nixos): remove Pantheon desktop support
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Feb 10, 2024
1 parent 12dca2a commit 1cf467f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 141 deletions.
15 changes: 3 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
# ];
# };
pc = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
vars = (import ./lib/vars.nix) { isDarwin = false; };
};
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./nixos-modules/common.nix
Expand All @@ -46,21 +43,15 @@
home-manager = {
useUserPackages = true;
users.mat = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
vars = (import ./lib/vars.nix) { isDarwin = false; };
};
extraSpecialArgs = { inherit inputs; };
};
}
];
};
};
homeConfigurations = {
"mac" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
vars = (import ./lib/vars.nix) { isDarwin = true; };
};
extraSpecialArgs = { inherit inputs; };
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
modules = [ inputs.arkenfox.hmModules.default ./home-manager/home.nix ];
};
Expand Down
10 changes: 7 additions & 3 deletions home-manager/modules/fish.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, lib, vars, ... }:
{ pkgs, lib, ... }:
let
inherit (pkgs) stdenv;
inherit (stdenv) isLinux;
Expand Down Expand Up @@ -41,8 +41,12 @@ in {
}];

shellAliases = {
copy = vars.copyCmd;
paste = vars.pasteCmd;
copy =
if pkgs.stdenv.isDarwin then "pbcopy" else "xclip -selection clipboard";
paste = if pkgs.stdenv.isDarwin then
"pbpaste"
else
"xlip -o -selection clipboard";
cat = "bat";
gogit = "cd ~/git";
"!!" = "eval \\$history[1]";
Expand Down
9 changes: 7 additions & 2 deletions home-manager/modules/git.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, vars, ... }:
{ pkgs, ... }:
let
inherit (pkgs) git stdenv;
inherit (stdenv) isLinux;
Expand Down Expand Up @@ -32,7 +32,12 @@ in {
!git fetch && git merge "origin/$(git branch --format '%(refname:short)' --sort=-committerdate --list master main | head -n1)"'';
add-ignore-whitespace =
"!git diff --ignore-all-space | git apply --cached";
copy-branch = "!git branch --show-current | ${vars.copyCmd}";
copy-branch = "!git branch --show-current | ${
if pkgs.stdenv.isDarwin then
"pbcopy"
else
"xclip -selection clipboard"
}";
pending = "!git log $(git describe --tags --abbrev=0)..HEAD --oneline";
};
extraConfig = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
{ pkgs, ... }:
let
wallpaperImg = pkgs.fetchurl {
url =
"https://user-images.githubusercontent.com/8648891/246180692-b8144052-e947-47b0-b59c-ea1022b9b629.jpg";
hash = "sha256-itnhNPYvQLfCULNrEZqP+3VBQVmEmvh9wv6C2F3YKQU=";
};
in {
# see https://github.com/wimpysworld/nix-config/blob/b8a260ddea1bbf088461f7272382d99acbf86ce7/home-manager/_mixins/desktop/pantheon.nix
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
button-layout = "close,minimize,maximize,appmenu:";
Expand Down Expand Up @@ -47,5 +55,16 @@
"org/gnome/shell/extensions/dash-to-dock" = {
intellihide-mode = "ALL_WINDOWS";
};
"org/gnome/desktop/background" = {
picture-uri = "file://${wallpaperImg}";
};
"org/gnome/desktop/datetime" = { automatic-timezone = true; };
"org/gnome/desktop/wm/keybindings" = {
move-to-monitor-left = [ "<Shift><Control><Alt>h" ];
move-to-monitor-right = [ "<Shift><Control><Alt>l" ];
move-to-monitor-up = [ "<Shift><Control><Alt>k" ];
move-to-monitor-down = [ "<Shift><Control><Alt>j" ];
};
"org/gnome/desktop/peripherals/touchpad" = { send-events = "enabled"; };
};
}
36 changes: 2 additions & 34 deletions home-manager/modules/gnome/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Shared stuff goes in here, and GNOME or Pantheon specific settings go in their own files
{ pkgs, config, lib, vars, ... }:
let
wallpaperImg = pkgs.fetchurl {
url =
"https://user-images.githubusercontent.com/8648891/246180692-b8144052-e947-47b0-b59c-ea1022b9b629.jpg";
hash = "sha256-itnhNPYvQLfCULNrEZqP+3VBQVmEmvh9wv6C2F3YKQU=";
};
inherit (vars) usePantheon;
inherit (vars) useGnome;
in {
imports = [ ] ++ lib.lists.optionals usePantheon [ ./pantheon.nix ]
++ lib.lists.optionals useGnome [ ./gnome.nix ];

{ pkgs, config, ... }: {
imports = [ ./dconf.nix ];
# workaround for https://github.com/nix-community/home-manager/issues/3447
# autostart 1Password in the background so I can use the SSH agent without manually opening the app first
xdg.configFile."autostart/1password.desktop".text = ''
Expand Down Expand Up @@ -39,26 +27,6 @@ in {
MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha;
Categories=Network;InstantMessaging;Chat;
'';

# see https://github.com/wimpysworld/nix-config/blob/b8a260ddea1bbf088461f7272382d99acbf86ce7/home-manager/_mixins/desktop/pantheon.nix
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
enable-hot-corners = false;
clock-show-weekday = true;
};
"org/gnome/desktop/background" = {
picture-uri = "file://${wallpaperImg}";
};
"org/gnome/desktop/datetime" = { automatic-timezone = true; };
"org/gnome/desktop/wm/keybindings" = {
move-to-monitor-left = [ "<Shift><Control><Alt>h" ];
move-to-monitor-right = [ "<Shift><Control><Alt>l" ];
move-to-monitor-up = [ "<Shift><Control><Alt>k" ];
move-to-monitor-down = [ "<Shift><Control><Alt>j" ];
};
"org/gnome/desktop/peripherals/touchpad" = { send-events = "enabled"; };
};
home.packages = [ pkgs.flameshot ];
gtk = {
gtk2 = {
Expand Down
50 changes: 0 additions & 50 deletions home-manager/modules/gnome/pantheon.nix

This file was deleted.

8 changes: 0 additions & 8 deletions lib/vars.nix

This file was deleted.

33 changes: 2 additions & 31 deletions nixos-modules/desktop_environment.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{ pkgs, lib, vars, ... }:
let
inherit (vars) usePantheon;
inherit (vars) useGnome;
in {
config = { } // lib.optionalAttrs useGnome {
{ pkgs, ... }: {
config = {
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
Expand Down Expand Up @@ -39,30 +35,5 @@ in {
no-overview
gtile
];
} // lib.optionalAttrs usePantheon {
environment.systemPackages = [ pkgs.pantheon.elementary-dock ];
programs.dconf.enable = true;
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
desktopManager.pantheon.enable = true;
displayManager.lightdm = {
enable = true;
greeters.pantheon.enable = true;
};
};
environment.pantheon.excludePackages = with pkgs.pantheon; [
appcenter
elementary-calculator
elementary-calendar
elementary-camera
elementary-code
elementary-feedback
elementary-mail
elementary-music
elementary-photos
elementary-tasks
elementary-videos
];
};
}

0 comments on commit 1cf467f

Please sign in to comment.