Add pre-commit hooks and fix style issues
This commit is contained in:
parent
c042fe2a77
commit
8637b08182
56 changed files with 229 additions and 302 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
|||
/result
|
||||
/secrets.nix
|
||||
/.direnv
|
||||
/.pre-commit-config.yaml
|
85
flake.lock
85
flake.lock
|
@ -38,31 +38,20 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ha-now-playing": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"naersk": [
|
||||
"naersk"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"pre-commit-hooks": "pre-commit-hooks",
|
||||
"pre-commit-hooks": [
|
||||
"pre-commit-hooks"
|
||||
],
|
||||
"rust-overlay": [
|
||||
"rust-overlay"
|
||||
]
|
||||
|
@ -111,11 +100,11 @@
|
|||
"wlroots": "wlroots"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1668863695,
|
||||
"narHash": "sha256-PFNI4C5W5GjTwwnewSbTTSg7NTrBYcwBFR8RgxJb0t4=",
|
||||
"lastModified": 1668879337,
|
||||
"narHash": "sha256-Lm9054CdFfOvHTLTtktSuOFri3k5wuEXb2LDDg44tb8=",
|
||||
"owner": "Hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "0ffaa8d6673c02e9360865c8cde69a606c036af7",
|
||||
"rev": "5530cf6e7939365ef6197a50c59bed20a64e3e11",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -167,11 +156,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1668790324,
|
||||
"narHash": "sha256-WPPvwnzY+RLqBC7TESfRbvfnKN4v5Sjz3MY7BD7nm3E=",
|
||||
"lastModified": 1668876315,
|
||||
"narHash": "sha256-7zGrnFju+sDuH5xkiyQomR1UROtmLI+UvR2zJG4vEi0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "02e332e8d01c5901dafaef15555384add24630cd",
|
||||
"rev": "87f6494e9daedaa583eb2b61d25e6d925193fb57",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -197,16 +186,18 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1667292599,
|
||||
"narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1668765800,
|
||||
"narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ef2f213d9659a274985778bff4ca322f3ef3ac68",
|
||||
"rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-22_05": {
|
||||
|
@ -225,22 +216,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1668765800,
|
||||
"narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pamedia": {
|
||||
"inputs": {
|
||||
"naersk": [
|
||||
|
@ -271,17 +246,18 @@
|
|||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"ha-now-playing",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1667992213,
|
||||
"narHash": "sha256-8Ens8ozllvlaFMCZBxg6S7oUyynYx2v7yleC5M0jJsE=",
|
||||
"lastModified": 1668880995,
|
||||
"narHash": "sha256-1pohNJx6MIVeYpXmsugZG3fUKPSIKpQouttWFVfqsNU=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "ebcbfe09d2bd6d15f68de3a0ebb1e4dcb5cd324b",
|
||||
"rev": "364568e63556045ea9d08d29fafa46febbdb015b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -300,8 +276,9 @@
|
|||
"naersk": "naersk",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pamedia": "pamedia",
|
||||
"pre-commit-hooks": "pre-commit-hooks",
|
||||
"rust-overlay": "rust-overlay",
|
||||
"sops": "sops",
|
||||
"sunshine": "sunshine"
|
||||
|
@ -394,11 +371,11 @@
|
|||
"flake": false,
|
||||
"locked": {
|
||||
"host": "gitlab.freedesktop.org",
|
||||
"lastModified": 1668292512,
|
||||
"narHash": "sha256-lCMnIguyZgAGq7W2IwIVPoQS8fAfZ/XFwz/1TQ53eI8=",
|
||||
"lastModified": 1668785720,
|
||||
"narHash": "sha256-CX+PYJP2PxZWL380WzyMNsrfRgIb/78brdwvDg/zj28=",
|
||||
"owner": "wlroots",
|
||||
"repo": "wlroots",
|
||||
"rev": "627a5c511278e67c3c308cdc6a639cbb490f48c3",
|
||||
"rev": "4ff46e6cf9463e594605928feeb7c55cf323b5e7",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
|
35
flake.nix
35
flake.nix
|
@ -13,6 +13,12 @@
|
|||
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -48,9 +54,10 @@
|
|||
ha-now-playing = {
|
||||
url = "git+https://git.datarift.nl/erwin/ha-now-playing.git?ref=main";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.utils.follows = "flake-utils";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.naersk.follows = "naersk";
|
||||
inputs.rust-overlay.follows = "rust-overlay";
|
||||
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
|
||||
};
|
||||
|
||||
pamedia = {
|
||||
|
@ -69,7 +76,6 @@
|
|||
|
||||
outputs =
|
||||
{ self
|
||||
, nixos-hardware
|
||||
, sops
|
||||
, ha-now-playing
|
||||
, pamedia
|
||||
|
@ -94,8 +100,9 @@
|
|||
self.overlays.default
|
||||
ha-now-playing.overlays.${system}
|
||||
pamedia.overlays.${system}
|
||||
inputs.emacs-overlay.overlay
|
||||
] ++ nixpkgs.lib.optional (system == "aarch64-linux")
|
||||
(final: super: {
|
||||
(_final: super: {
|
||||
makeModulesClosure = x:
|
||||
super.makeModulesClosure (x // { allowMissing = true; });
|
||||
});
|
||||
|
@ -140,11 +147,11 @@
|
|||
nixosConfigurations = builtins.listToAttrs (map
|
||||
(machine: {
|
||||
name = machine;
|
||||
value = (defSystem (machines.${machine}.system or "x86_64-linux") {
|
||||
value = defSystem (machines.${machine}.system or "x86_64-linux") {
|
||||
imports = [
|
||||
machines.${machine}.config
|
||||
];
|
||||
});
|
||||
};
|
||||
})
|
||||
(builtins.attrNames machines));
|
||||
}
|
||||
|
@ -180,8 +187,26 @@
|
|||
backscrub = flake-utils.lib.mkApp { drv = packages.backscrub; };
|
||||
};
|
||||
|
||||
checks = {
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
black.enable = true;
|
||||
shellcheck = {
|
||||
enable = true;
|
||||
types_or = [ "executable" ];
|
||||
};
|
||||
shfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = with pkgs;
|
||||
mkShell {
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
name = "dotfiles";
|
||||
nativeBuildInputs = [
|
||||
pkgs.sops
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -18,15 +18,6 @@ with lib; let
|
|||
mimeTypes = [ "x-scheme-handler/org-protocol" ];
|
||||
startupWMClass = "Emacs";
|
||||
};
|
||||
|
||||
valeToINI = generators.toINIWithGlobalSection {
|
||||
mkKeyValue = generators.mkKeyValueDefault
|
||||
{
|
||||
mkValueString = v:
|
||||
if builtins.isList v then builtins.concatStringsSep ", " v
|
||||
else generators.mkValueStringDefault { } v;
|
||||
} " = ";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.eboskma.programs.emacs = {
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
{ lib, config, ... }:
|
||||
with lib; let
|
||||
cfg = config.eboskma.programs.foot;
|
||||
in
|
||||
|
|
|
@ -20,7 +20,7 @@ in
|
|||
{
|
||||
options.eboskma.programs.hyprland = { enable = mkEnableOption "Hyprland"; };
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2148
|
||||
|
||||
confirm() {
|
||||
rofi -dmenu \
|
||||
-i \
|
||||
-no-fixed-num-lines \
|
||||
-p "Are you sure? [y/n]: " \
|
||||
-theme power
|
||||
rofi -dmenu \
|
||||
-i \
|
||||
-no-fixed-num-lines \
|
||||
-p "Are you sure? [y/n]: " \
|
||||
-theme power
|
||||
}
|
||||
|
||||
# Options
|
||||
|
@ -22,33 +22,33 @@ lockcmd="i3lock --ignore-empty-password --show-failed-attempts --clock --color=3
|
|||
|
||||
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
||||
|
||||
if [[ "${chosen}" == "" ]]; then
|
||||
exit 0
|
||||
if [[ ${chosen} == "" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${chosen}" == "${lock}" ]]; then
|
||||
${lockcmd}
|
||||
exit 0
|
||||
if [[ ${chosen} == "${lock}" ]]; then
|
||||
${lockcmd}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
answer=$(confirm)
|
||||
|
||||
if [[ "${answer}" == "y" ]]; then
|
||||
case "${chosen}" in
|
||||
"${shutdown}")
|
||||
systemctl poweroff
|
||||
;;
|
||||
"${reboot}")
|
||||
systemctl reboot
|
||||
;;
|
||||
"${hibernate}")
|
||||
${lockcmd}
|
||||
systemctl hibernate
|
||||
;;
|
||||
"${exit_wm}")
|
||||
i3-msg exit
|
||||
;;
|
||||
*) ;;
|
||||
if [[ ${answer} == "y" ]]; then
|
||||
case "${chosen}" in
|
||||
"${shutdown}")
|
||||
systemctl poweroff
|
||||
;;
|
||||
"${reboot}")
|
||||
systemctl reboot
|
||||
;;
|
||||
"${hibernate}")
|
||||
${lockcmd}
|
||||
systemctl hibernate
|
||||
;;
|
||||
"${exit_wm}")
|
||||
i3-msg exit
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
esac
|
||||
fi
|
||||
|
|
|
@ -9,7 +9,7 @@ in
|
|||
{
|
||||
options.eboskma.programs.mpd = { enable = mkEnableOption "mpd"; };
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
network = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
|
@ -13,7 +12,7 @@ in
|
|||
{
|
||||
options.eboskma.programs.picom = { enable = mkEnableOption "activate picom"; };
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
# home.packages = [pkgs.nixgl.auto.nixGLDefault];
|
||||
|
||||
services.picom = {
|
||||
|
|
|
@ -65,7 +65,7 @@ in
|
|||
{
|
||||
options.eboskma.programs.polybar = { enable = mkEnableOption "activate polybar"; };
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
# systemd.user.services.polybar = {
|
||||
# Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
# };
|
||||
|
|
|
@ -6,27 +6,29 @@ import gi
|
|||
from gi.repository import GLib
|
||||
|
||||
# Check Playerctl version
|
||||
gi.require_version('Playerctl', '2.0')
|
||||
gi.require_version("Playerctl", "2.0")
|
||||
from gi.repository import Playerctl
|
||||
|
||||
|
||||
def player_status_str(status):
|
||||
if status == Playerctl.PlaybackStatus.PLAYING:
|
||||
return 'Playing'
|
||||
return "Playing"
|
||||
elif status == Playerctl.PlaybackStatus.PAUSED:
|
||||
return 'Paused'
|
||||
return "Paused"
|
||||
elif status == Playerctl.PlaybackStatus.STOPPED:
|
||||
return 'Stopped'
|
||||
return "Stopped"
|
||||
else:
|
||||
return 'Unknown'
|
||||
return "Unknown"
|
||||
|
||||
|
||||
def now_playing_str(artist, title):
|
||||
if artist == None and title == None:
|
||||
return 'No music information'
|
||||
return "No music information"
|
||||
elif artist == None:
|
||||
return title
|
||||
else:
|
||||
return f'{artist} - {title}'
|
||||
return f"{artist} - {title}"
|
||||
|
||||
|
||||
players = Playerctl.list_players()
|
||||
|
||||
|
@ -34,12 +36,12 @@ if len(players) == 0:
|
|||
print("No players found")
|
||||
exit(0)
|
||||
|
||||
homedir = os.environ['HOME']
|
||||
player_file = f'{homedir}/.playerctl_player'
|
||||
current_player_name = ''
|
||||
homedir = os.environ["HOME"]
|
||||
player_file = f"{homedir}/.playerctl_player"
|
||||
current_player_name = ""
|
||||
|
||||
if os.path.isfile(player_file):
|
||||
with open(player_file, mode='r') as file:
|
||||
with open(player_file, mode="r") as file:
|
||||
current_player_name = file.read()
|
||||
|
||||
player_found = False
|
||||
|
@ -61,24 +63,24 @@ if len(sys.argv) == 1:
|
|||
if player.props.playback_status == Playerctl.PlaybackStatus.PLAYING:
|
||||
out += now_playing_str(player.get_artist(), player.get_title())
|
||||
else:
|
||||
out += player_status_str(player.get_property('playback_status'))
|
||||
out += player_status_str(player.get_property("playback_status"))
|
||||
|
||||
print(out)
|
||||
elif sys.argv[1] == 'next-player':
|
||||
elif sys.argv[1] == "next-player":
|
||||
player_changed = True
|
||||
player_index += 1
|
||||
if player_index == len(players):
|
||||
player_index = 0
|
||||
|
||||
player = Playerctl.Player.new_from_name(players[player_index])
|
||||
elif sys.argv[1] == 'play-pause':
|
||||
elif sys.argv[1] == "play-pause":
|
||||
player.play_pause()
|
||||
elif sys.argv[1] == 'next':
|
||||
elif sys.argv[1] == "next":
|
||||
player.next()
|
||||
elif sys.argv[1] == 'previous':
|
||||
elif sys.argv[1] == "previous":
|
||||
player.previous()
|
||||
|
||||
if player_changed or not player_found:
|
||||
with open(player_file, mode='w') as file:
|
||||
file.write(player.get_property('player-instance'))
|
||||
with open(player_file, mode="w") as file:
|
||||
file.write(player.get_property("player-instance"))
|
||||
file.flush()
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
@ -18,7 +17,7 @@ in
|
|||
hashKnownHosts = true;
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
identityFile = (if var.workSystem then horusKey else personalKey);
|
||||
identityFile = if var.workSystem then horusKey else personalKey;
|
||||
identitiesOnly = true;
|
||||
extraOptions = {
|
||||
Ciphers = "chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr";
|
||||
|
@ -63,7 +62,7 @@ in
|
|||
};
|
||||
|
||||
"git.datarift.nl" = {
|
||||
hostname = (if var.workSystem then "direct.datarift.nl" else "10.0.0.201");
|
||||
hostname = if var.workSystem then "direct.datarift.nl" else "10.0.0.201";
|
||||
};
|
||||
|
||||
fluiddpi = mkIf (!var.workSystem) {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# shellcheck disable=SC2148
|
||||
|
||||
confirm() {
|
||||
rofi -dmenu \
|
||||
-i \
|
||||
-no-fixed-num-lines \
|
||||
-p "Are you sure? [y/n]: " \
|
||||
-theme power
|
||||
rofi -dmenu \
|
||||
-i \
|
||||
-no-fixed-num-lines \
|
||||
-p "Are you sure? [y/n]: " \
|
||||
-theme power
|
||||
}
|
||||
|
||||
# Options
|
||||
|
@ -25,37 +27,37 @@ lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --i
|
|||
|
||||
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
|
||||
|
||||
if [[ "${chosen}" == "" ]]; then
|
||||
exit 0
|
||||
if [[ ${chosen} == "" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${chosen}" == "${lock}" ]]; then
|
||||
${lockcmd}
|
||||
exit 0
|
||||
if [[ ${chosen} == "${lock}" ]]; then
|
||||
${lockcmd}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
answer=$(confirm)
|
||||
|
||||
if [[ "${answer}" == "y" ]]; then
|
||||
case "${chosen}" in
|
||||
"${shutdown}")
|
||||
systemctl poweroff
|
||||
;;
|
||||
"${reboot}")
|
||||
systemctl reboot
|
||||
;;
|
||||
"${hibernate}")
|
||||
${lockcmd}
|
||||
systemctl hibernate
|
||||
;;
|
||||
"${exit_wm}")
|
||||
if [[ ${XDG_CURRENT_DESKTOP} = "sway" ]]; then
|
||||
swaymsg exit
|
||||
elif [[ ${XDG_CURRENT_DESKTOP} = "Hyprland" ]]; then
|
||||
hyprctl dispatch exit
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
if [[ ${answer} == "y" ]]; then
|
||||
case "${chosen}" in
|
||||
"${shutdown}")
|
||||
systemctl poweroff
|
||||
;;
|
||||
"${reboot}")
|
||||
systemctl reboot
|
||||
;;
|
||||
"${hibernate}")
|
||||
${lockcmd}
|
||||
systemctl hibernate
|
||||
;;
|
||||
"${exit_wm}")
|
||||
if [[ ${XDG_CURRENT_DESKTOP} == "sway" ]]; then
|
||||
swaymsg exit
|
||||
elif [[ ${XDG_CURRENT_DESKTOP} == "Hyprland" ]]; then
|
||||
hyprctl dispatch exit
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
esac
|
||||
fi
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, flake-inputs
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
|
|
|
@ -20,7 +20,7 @@ in
|
|||
enable = mkEnableOption "wallpapers";
|
||||
backgroundColor = mkOption {
|
||||
description = "Hex value of the background color";
|
||||
type = (types.strMatching "#[[:xdigit:]]{6}");
|
||||
type = types.strMatching "#[[:xdigit:]]{6}";
|
||||
default = "#000000";
|
||||
example = "#ff0000";
|
||||
};
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
}:
|
||||
with lib; let
|
||||
cfg = config.eboskma.programs.waybar;
|
||||
|
||||
wb-dunst = pkgs.writeShellScriptBin "wb-dunst" ''
|
||||
COUNT=$(${pkgs.dunst}/bin/dunstctl count waiting)
|
||||
ENABLED=" "
|
||||
DISABLED=" "
|
||||
if [[ ''${COUNT} != 0 ]]; then DISABLED=" ''${COUNT}"; fi
|
||||
if ${pkgs.dunst}/bin/dunstctl is-paused | grep -q "false" ; then ${pkgs.coreutils}/bin/echo "''${ENABLED}"; else ${pkgs.coreutils}/bin/echo "''${DISABLED}"; fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar";
|
||||
|
|
|
@ -15,7 +15,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.xbanish = {
|
||||
Unit = {
|
||||
Description = "xbanish hides the mouse pointer when typing";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.programs.zellij;
|
||||
|
@ -13,7 +13,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
config = mkIf cfg.enable {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
@ -5,7 +5,7 @@ let
|
|||
|
||||
lib = import "${krops}/lib";
|
||||
pkgs = import "${krops}/pkgs" { };
|
||||
source = name:
|
||||
source = _name:
|
||||
lib.evalSource [
|
||||
{
|
||||
machine-config.file = toString ./.;
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
{ ... }@inputs: {
|
||||
inputs: {
|
||||
drone = {
|
||||
config = (import ./drone/configuration.nix inputs);
|
||||
config = import ./drone/configuration.nix inputs;
|
||||
};
|
||||
eitri = {
|
||||
system = "aarch64-linux";
|
||||
config = (import ./eitri/configuration.nix inputs);
|
||||
config = import ./eitri/configuration.nix inputs;
|
||||
};
|
||||
gitea = {
|
||||
config = (import ./gitea/configuration.nix inputs);
|
||||
config = import ./gitea/configuration.nix inputs;
|
||||
};
|
||||
heimdall = {
|
||||
config = (import ./heimdall/configuration.nix inputs);
|
||||
config = import ./heimdall/configuration.nix inputs;
|
||||
};
|
||||
loki = {
|
||||
config = (import ./loki/configuration.nix inputs);
|
||||
config = import ./loki/configuration.nix inputs;
|
||||
};
|
||||
mimir = {
|
||||
config = (import ./mimir/configuration.nix inputs);
|
||||
config = import ./mimir/configuration.nix inputs;
|
||||
};
|
||||
proxy = {
|
||||
config = (import ./proxy/configuration.nix inputs);
|
||||
config = import ./proxy/configuration.nix inputs;
|
||||
};
|
||||
vm1 = {
|
||||
config = (import ./vm1/configuration.nix inputs);
|
||||
config = import ./vm1/configuration.nix inputs;
|
||||
};
|
||||
vm2 = {
|
||||
config = (import ./vm2/configuration.nix inputs);
|
||||
config = import ./vm2/configuration.nix inputs;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
{ modulesPath
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ self, nixpkgs, nixos-hardware, ... }:
|
||||
{ nixpkgs, nixos-hardware, ... }:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
system = "aarch64-linux";
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
, ...
|
||||
}: {
|
||||
{ modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/lxc-container.nix")
|
||||
];
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
, ...
|
||||
}: {
|
||||
{ modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/proxmox-image.nix")
|
||||
];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ self, nixpkgs, nixos-hardware, hyprland, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{ nixos-hardware, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
nixos-hardware.nixosModules.common-cpu-amd
|
||||
|
@ -44,7 +44,11 @@
|
|||
element-web.enable = false;
|
||||
fonts.enable = true;
|
||||
gnome.enable = true;
|
||||
greetd.enable = true;
|
||||
greetd = {
|
||||
enable = true;
|
||||
sway = true;
|
||||
hyprland = false;
|
||||
};
|
||||
# home-manager = {
|
||||
# inherit (users) users;
|
||||
# enable = true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
, ...
|
||||
}: {
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ self, nixpkgs, nixos-hardware, ... }:
|
||||
{ nixos-hardware, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" ];
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
{ modulesPath
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ self, ... }: {
|
||||
{ ... }: {
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
eboskma = {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
{ modulesPath
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ self, ... }: {
|
||||
{ ... }: {
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
eboskma = {
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, modulesPath
|
||||
, ...
|
||||
}: {
|
||||
{ modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{ mkDerivation, lib }:
|
||||
let
|
||||
udevRules = ''
|
||||
'';
|
||||
in
|
||||
mkDerivation
|
||||
{
|
||||
pname = "blink1-udev-rules";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, inputs
|
||||
, self-overlay
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
with lib; let
|
||||
cfg = config.eboskma.drone;
|
||||
in
|
||||
|
|
|
@ -14,6 +14,8 @@ in
|
|||
{
|
||||
options.eboskma.greetd = {
|
||||
enable = mkEnableOption "enable greetd";
|
||||
sway = mkEnableOption "sway";
|
||||
hyprland = mkEnableOption "hyprland";
|
||||
};
|
||||
|
||||
config =
|
||||
|
@ -46,11 +48,10 @@ in
|
|||
group = "greeter";
|
||||
};
|
||||
"greetd/environments" = {
|
||||
text = ''
|
||||
${pkgs.sway}/bin/sway
|
||||
${hyprland}/bin/Hyprland
|
||||
${pkgs.bash}/bin/bash
|
||||
'';
|
||||
text = concatStringsSep "\n" ([ ]
|
||||
++ (optional cfg.sway "${pkgs.sway}/bin/sway")
|
||||
++ (optional cfg.hyprland "${hyprland}/bin/Hyprland")
|
||||
++ [ "${pkgs.bash}/bin/bash" ]);
|
||||
user = "greeter";
|
||||
group = "greeter";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.lightdm;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.nix-serve;
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.eboskma.var;
|
||||
in
|
||||
{
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
options.eboskma.var = {
|
||||
mainUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "erwin";
|
||||
description = ''
|
||||
The main system user
|
||||
'';
|
||||
type = lib.types.str;
|
||||
default = "erwin";
|
||||
description = ''
|
||||
The main system user
|
||||
'';
|
||||
};
|
||||
|
||||
workSystem = lib.mkOption {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs
|
||||
, config
|
||||
{ config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.tablet;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
final: prev: rec {
|
||||
_final: prev: rec {
|
||||
rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland { };
|
||||
nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins { };
|
||||
lunarvim = prev.pkgs.callPackage ../pkgs/lunarvim { };
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
{ buildGoModule, fetchFromGitHub, ... }:
|
||||
let
|
||||
version = "2.2.18";
|
||||
in
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
disabled = [
|
||||
"manual_inherit_from"
|
||||
]
|
||||
nix_version = "2.8"
|
||||
nix_version = "2.11"
|
||||
ignore = [".direnv"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.eboskma.users.builder;
|
||||
|
|
|
@ -4,7 +4,19 @@ let
|
|||
cfg = config.eboskma.users.erwin;
|
||||
in
|
||||
{
|
||||
options.eboskma.users.erwin = { enable = mkEnableOption "user account for Erwin"; };
|
||||
options.eboskma.users.erwin = {
|
||||
enable = mkEnableOption "user account for Erwin";
|
||||
|
||||
home = mkEnableOption "home profile";
|
||||
work = mkEnableOption "work profile";
|
||||
terminal = mkOption {
|
||||
type = types.str;
|
||||
default = "foot";
|
||||
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
imports = [ ./home.nix ./work.nix ];
|
||||
|
||||
|
|
|
@ -1,24 +1,9 @@
|
|||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, inputs
|
||||
, self-overlay
|
||||
, ...
|
||||
}:
|
||||
{ pkgs, config, lib, inputs, self-overlay, ... }:
|
||||
with lib; let
|
||||
cfg = config.eboskma.users.erwin;
|
||||
bt = config.eboskma.bluetooth;
|
||||
in
|
||||
{
|
||||
options.eboskma.users.erwin = {
|
||||
home = mkEnableOption "home profile";
|
||||
terminal = mkOption {
|
||||
type = types.str;
|
||||
default = "foot";
|
||||
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.home {
|
||||
home-manager.users.erwin = {
|
||||
|
@ -35,7 +20,7 @@ in
|
|||
EDITOR = "${pkgs.neovim}/bin/nvim";
|
||||
};
|
||||
|
||||
nixpkgs.config = { allowUnfree = true; };
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home.stateVersion = "21.11";
|
||||
|
||||
|
@ -69,7 +54,7 @@ in
|
|||
signingKeyFormat = "ssh";
|
||||
};
|
||||
gpg.enable = true;
|
||||
hyprland.enable = true;
|
||||
hyprland.enable = false;
|
||||
neovim.enable = true;
|
||||
obs-studio.enable = true;
|
||||
rclone = {
|
||||
|
|
|
@ -4,11 +4,7 @@ let
|
|||
cfg = config.eboskma.users.erwin;
|
||||
in
|
||||
{
|
||||
options.eboskma.users.erwin = {
|
||||
work = mkEnableOption "work profile";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.work) {
|
||||
config = mkIf cfg.work {
|
||||
home-manager.users.erwin = {
|
||||
_module.args.flake-inputs = inputs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue