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 {
|
||||
this.application.emacs.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "Insert joke about emacs is an operating system.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -5,14 +5,12 @@ let
|
|||
sway_cfg = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.firefox = {
|
||||
enable = mkOption {
|
||||
this.application.firefox.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.kitty = {
|
||||
enable = mkOption {
|
||||
this.application.kitty.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,12 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.nextcloud = {
|
||||
enable = mkOption {
|
||||
this.application.nextcloud.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "Dropbox for people who don't like dropbox";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.dunst = {
|
||||
enable = mkOption {
|
||||
this.application.dunst.enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.gammastep = {
|
||||
enable = mkOption {
|
||||
this.application.gammastep.enable = mkOption {
|
||||
default = sway.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,14 +4,12 @@ let
|
|||
sway = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.mako = {
|
||||
enable = mkOption {
|
||||
this.application.mako.enable = mkOption {
|
||||
default = false;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
@ -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 {
|
||||
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,22 +136,21 @@ in with lib; {
|
|||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
systemd.user.targets.sway-session = {
|
||||
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 = {
|
||||
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";
|
||||
|
@ -168,6 +164,7 @@ in with lib; {
|
|||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.james.extraGroups = [ "video" "audio" ];
|
||||
};
|
||||
|
|
|
@ -4,14 +4,12 @@ let
|
|||
sway_cfg = config.this.application.sway;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.application.waybar = {
|
||||
enable = mkOption {
|
||||
this.application.waybar.enable = mkOption {
|
||||
default = sway_cfg.enable;
|
||||
type = with types; bool;
|
||||
description = "testing one two three";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = { home.packages = with pkgs; [ waybar ]; };
|
||||
|
|
|
@ -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,13 +4,11 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.bash = {
|
||||
enable = mkOption {
|
||||
this.lang.bash.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.golang = {
|
||||
enable = mkOption {
|
||||
this.lang.golang.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
this.lang.javascript = {
|
||||
enable = mkOption {
|
||||
this.lang.javascript.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.james = {
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let cfg = config.this.systems.boot;
|
||||
in with lib; {
|
||||
options.this.systems.boot = {
|
||||
enable = mkOption {
|
||||
options.this.systems.boot.enable = mkOption {
|
||||
default = true;
|
||||
type = with types; bool;
|
||||
description = "Is there a physical power button?";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot = {
|
||||
|
|
|
@ -4,13 +4,11 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
systems.displaymanager = {
|
||||
enable = mkOption {
|
||||
systems.displaymanager.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
|
|
|
@ -4,12 +4,9 @@ let
|
|||
graphical = config.this.graphical;
|
||||
in with lib; {
|
||||
options = {
|
||||
systems.flatpak = {
|
||||
enable = mkOption {
|
||||
systems.flatpak.enable = mkOption {
|
||||
default = graphical.enable;
|
||||
type = with types; bool;
|
||||
description = "When they tried to do docker for GUIs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -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