Refactor
This commit is contained in:
parent
aaea0f79a4
commit
94613c579e
|
@ -6,12 +6,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.emacs = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "Insert joke about emacs is an operating system.";
|
||||
};
|
||||
this.application.emacs.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -5,12 +5,10 @@ let
|
|||
sway_cfg = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.firefox = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "";
|
||||
};
|
||||
this.application.firefox.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.kitty = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.application.kitty.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,12 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.nextcloud = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "Dropbox for people who don't like dropbox";
|
||||
};
|
||||
this.application.nextcloud.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.dunst = {
|
||||
enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.application.dunst.enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.gammastep = {
|
||||
enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.application.gammastep.enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,12 +4,10 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.mako = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
this.application.mako.enable = mkOption {
|
||||
default = false;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -63,21 +61,5 @@ in with lib; {
|
|||
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";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,16 +15,13 @@ let
|
|||
scripts = [ brightness-sh sway-entry volume-sh ];
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.sway = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.application.sway.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
this.graphical.protocol = "Wayland";
|
||||
|
||||
home-manager.users.james = {
|
||||
|
@ -139,33 +136,33 @@ in with lib; {
|
|||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
systemd.user.targets.sway-session = {
|
||||
description = "Sway compositor session";
|
||||
documentation = [ "man:systemd.special(7)" ];
|
||||
bindsTo = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
systemd.user.services.sway = {
|
||||
enable = true;
|
||||
description = "Sway - Wayland window manager";
|
||||
documentation = [ "man:sway(5)" ];
|
||||
bindsTo = [ "default.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
# We explicitly unset PATH here, as we want it to be set by
|
||||
# systemctl --user import-environment in startsway
|
||||
environment.PATH = lib.mkForce null;
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart =
|
||||
"${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug";
|
||||
ExecStopPost =
|
||||
"/usr/bin/env systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
|
||||
NotifyAccess = "all";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
systemd.user = {
|
||||
targets.sway-session = {
|
||||
description = "Sway compositor session";
|
||||
documentation = [ "man:systemd.special(7)" ];
|
||||
bindsTo = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
services.sway = {
|
||||
enable = true;
|
||||
description = "Sway - Wayland window manager";
|
||||
documentation = [ "man:sway(5)" ];
|
||||
bindsTo = [ "default.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
environment.PATH = lib.mkForce null;
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart =
|
||||
"${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug";
|
||||
ExecStopPost =
|
||||
"/usr/bin/env systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
|
||||
NotifyAccess = "all";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,12 +4,10 @@ let
|
|||
sway_cfg = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.waybar = {
|
||||
enable = mkOption {
|
||||
default = sway_cfg.enable;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
this.application.waybar.enable = mkOption {
|
||||
default = sway_cfg.enable;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
options.this.graphical.enable = lib.mkOption {
|
||||
default = false;
|
||||
type = with lib.types; bool;
|
||||
description = "Does this actually need X/Wayland";
|
||||
};
|
||||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
in {
|
||||
|
||||
options.this.graphical.enable =
|
||||
mkEnableOption "Does this actually need X/Wayland";
|
||||
|
||||
options.this.graphical.protocol = mkOption {
|
||||
type = types.enum [ "X11" "Wayland" ];
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.bash = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.lang.bash.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.golang = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.lang.golang.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.javascript = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
this.lang.javascript.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let cfg = config.this.systems.boot;
|
||||
in with lib; {
|
||||
options.this.systems.boot = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = with types; bool;
|
||||
description = "Is there a physical power button?";
|
||||
};
|
||||
options.this.systems.boot.enable = mkOption {
|
||||
default = true;
|
||||
type = with types; bool;
|
||||
description = "Is there a physical power button?";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -4,11 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
systems.displaymanager = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
systems.displaymanager.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,12 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
systems.flatpak = {
|
||||
enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "When they tried to do docker for GUIs";
|
||||
};
|
||||
systems.flatpak.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -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, ... }: {
|
||||
home-manager.users.james = {
|
||||
home.packages = with pkgs; [ xdg-utils xdg-launch ];
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let cfg = config.this.systems.zfs;
|
||||
in with lib; {
|
||||
options.this.systems.zfs = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = with types; bool;
|
||||
description = "enable zfs";
|
||||
};
|
||||
};
|
||||
options.this.systems.zfs.enable = mkEnableOption "zfs";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot = {
|
||||
|
|
Reference in New Issue
Block a user