This commit is contained in:
James Patrick 2022-03-24 00:00:26 -04:00
parent aaea0f79a4
commit 94613c579e
18 changed files with 84 additions and 142 deletions

View File

@ -6,12 +6,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.application.emacs = { this.application.emacs.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
description = "Insert joke about emacs is an operating system.";
};
}; };
}; };

View File

@ -5,12 +5,10 @@ let
sway_cfg = config.this.application.sway; sway_cfg = config.this.application.sway;
in with lib; { in with lib; {
options = { options = {
this.application.firefox = { this.application.firefox.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool; description = "";
description = "";
};
}; };
}; };

View File

@ -4,11 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.application.kitty = { this.application.kitty.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,12 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.application.nextcloud = { this.application.nextcloud.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
description = "Dropbox for people who don't like dropbox";
};
}; };
}; };

View File

@ -4,11 +4,9 @@ let
sway = config.this.application.sway; sway = config.this.application.sway;
in with lib; { in with lib; {
options = { options = {
this.application.dunst = { this.application.dunst.enable = mkOption {
enable = mkOption { default = sway.enable;
default = sway.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,11 +4,9 @@ let
sway = config.this.application.sway; sway = config.this.application.sway;
in with lib; { in with lib; {
options = { options = {
this.application.gammastep = { this.application.gammastep.enable = mkOption {
enable = mkOption { default = sway.enable;
default = sway.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,12 +4,10 @@ let
sway = config.this.application.sway; sway = config.this.application.sway;
in with lib; { in with lib; {
options = { options = {
this.application.mako = { this.application.mako.enable = mkOption {
enable = mkOption { default = false;
default = false; type = with types; bool;
type = with types; bool; description = "testing one two three";
description = "testing one two three";
};
}; };
}; };
@ -63,21 +61,5 @@ in with lib; {
Restart = "always"; Restart = "always";
}; };
}; };
# systemd.user.services.mako = {
# enable = true;
# description = "Mako - Notificaitons for Wayland";
# documentation = [ "man:mako(5)" ];
# partOf = [ "sway-session.target" ];
# bindsTo = [ "sway-session.target" ];
# environment.PATH = lib.mkForce null;
# serviceConfig = {
# ExecStart = "${pkgs.mako}/bin/mako";
# Restart = "on-failure";
# RestartSec = 1;
# TimeoutStopSec = 10;
# Type = "simple";
# };
# };
}; };
} }

View File

@ -15,16 +15,13 @@ let
scripts = [ brightness-sh sway-entry volume-sh ]; scripts = [ brightness-sh sway-entry volume-sh ];
in with lib; { in with lib; {
options = { options = {
this.application.sway = { this.application.sway.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
this.graphical.protocol = "Wayland"; this.graphical.protocol = "Wayland";
home-manager.users.james = { home-manager.users.james = {
@ -139,33 +136,33 @@ in with lib; {
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
}; };
systemd.user.targets.sway-session = { systemd.user = {
description = "Sway compositor session"; targets.sway-session = {
documentation = [ "man:systemd.special(7)" ]; description = "Sway compositor session";
bindsTo = [ "graphical-session.target" ]; documentation = [ "man:systemd.special(7)" ];
wants = [ "graphical-session-pre.target" ]; bindsTo = [ "graphical-session.target" ];
after = [ "graphical-session-pre.target" ]; wants = [ "graphical-session-pre.target" ];
}; after = [ "graphical-session-pre.target" ];
systemd.user.services.sway = { };
enable = true; services.sway = {
description = "Sway - Wayland window manager"; enable = true;
documentation = [ "man:sway(5)" ]; description = "Sway - Wayland window manager";
bindsTo = [ "default.target" ]; documentation = [ "man:sway(5)" ];
wants = [ "graphical-session-pre.target" ]; bindsTo = [ "default.target" ];
after = [ "graphical-session-pre.target" ]; wants = [ "graphical-session-pre.target" ];
# We explicitly unset PATH here, as we want it to be set by after = [ "graphical-session-pre.target" ];
# systemctl --user import-environment in startsway environment.PATH = lib.mkForce null;
environment.PATH = lib.mkForce null; serviceConfig = {
serviceConfig = { Type = "simple";
Type = "simple"; ExecStart =
ExecStart = "${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug";
"${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug"; ExecStopPost =
ExecStopPost = "/usr/bin/env systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
"/usr/bin/env systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY"; NotifyAccess = "all";
NotifyAccess = "all"; Restart = "on-failure";
Restart = "on-failure"; RestartSec = 1;
RestartSec = 1; TimeoutStopSec = 10;
TimeoutStopSec = 10; };
}; };
}; };

View File

@ -4,12 +4,10 @@ let
sway_cfg = config.this.application.sway; sway_cfg = config.this.application.sway;
in with lib; { in with lib; {
options = { options = {
this.application.waybar = { this.application.waybar.enable = mkOption {
enable = mkOption { default = sway_cfg.enable;
default = sway_cfg.enable; type = with types; bool;
type = with types; bool; description = "testing one two three";
description = "testing one two three";
};
}; };
}; };

View File

@ -1,9 +1,10 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }:
options.this.graphical.enable = lib.mkOption { with lib;
default = false; let
type = with lib.types; bool; in {
description = "Does this actually need X/Wayland";
}; options.this.graphical.enable =
mkEnableOption "Does this actually need X/Wayland";
options.this.graphical.protocol = mkOption { options.this.graphical.protocol = mkOption {
type = types.enum [ "X11" "Wayland" ]; type = types.enum [ "X11" "Wayland" ];

View File

@ -4,11 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.lang.bash = { this.lang.bash.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,11 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.lang.golang = { this.lang.golang.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,11 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
this.lang.javascript = { this.lang.javascript.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -1,12 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.this.systems.boot; let cfg = config.this.systems.boot;
in with lib; { in with lib; {
options.this.systems.boot = { options.this.systems.boot.enable = mkOption {
enable = mkOption { default = true;
default = true; type = with types; bool;
type = with types; bool; description = "Is there a physical power button?";
description = "Is there a physical power button?";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -4,11 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
systems.displaymanager = { systems.displaymanager.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
};
}; };
}; };

View File

@ -4,12 +4,9 @@ let
graphical = config.this.graphical; graphical = config.this.graphical;
in with lib; { in with lib; {
options = { options = {
systems.flatpak = { systems.flatpak.enable = mkOption {
enable = mkOption { default = graphical.enable;
default = graphical.enable; type = with types; bool;
type = with types; bool;
description = "When they tried to do docker for GUIs";
};
}; };
}; };

View File

@ -1,6 +1,3 @@
# This was cribed from Hlisser's dotfiles see here
# https://github.com/hlissner/dotfiles/blob/8fe1fbb6e7fc0d2f95fe75cdb9df7eb0595a0047/modules/xdg.nix
{ config, pkgs, ... }: { { config, pkgs, ... }: {
home-manager.users.james = { home-manager.users.james = {
home.packages = with pkgs; [ xdg-utils xdg-launch ]; home.packages = with pkgs; [ xdg-utils xdg-launch ];

View File

@ -1,13 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.this.systems.zfs; let cfg = config.this.systems.zfs;
in with lib; { in with lib; {
options.this.systems.zfs = { options.this.systems.zfs.enable = mkEnableOption "zfs";
enable = mkOption {
default = false;
type = with types; bool;
description = "enable zfs";
};
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
boot = { boot = {