mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
nix fmt
This commit is contained in:
parent
d87d39f4e5
commit
548972f14c
79
flake.nix
79
flake.nix
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
description =
|
description = "Flake to define configurations of 'elss' - ellmauthaler stefan's systems";
|
||||||
"Flake to define configurations of 'elss' - ellmauthaler stefan's systems";
|
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
@ -12,14 +11,14 @@
|
|||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
#};
|
#};
|
||||||
|
|
||||||
nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; };
|
nixos-hardware = {url = "github:NixOS/nixos-hardware/master";};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.05";
|
url = "github:nix-community/home-manager/release-23.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
flake-utils-plus = { url = "github:gytis-ivaskevicius/flake-utils-plus"; };
|
flake-utils-plus = {url = "github:gytis-ivaskevicius/flake-utils-plus";};
|
||||||
|
|
||||||
emacs-overlay = {
|
emacs-overlay = {
|
||||||
url = "github:nix-community/emacs-overlay";
|
url = "github:nix-community/emacs-overlay";
|
||||||
@ -53,16 +52,27 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils-plus, ... }@inputs:
|
outputs = {
|
||||||
let
|
self,
|
||||||
extended-lib = nixpkgs.lib.extend
|
nixpkgs,
|
||||||
(final: prev: { elss = (import ./lib { lib = final; }) prev; });
|
flake-utils-plus,
|
||||||
inherit (extended-lib.elss)
|
...
|
||||||
discoverModules moduleNames discoverMachines withModules
|
} @ inputs: let
|
||||||
discoverTemplates;
|
extended-lib =
|
||||||
in flake-utils-plus.lib.mkFlake rec {
|
nixpkgs.lib.extend
|
||||||
|
(final: prev: {elss = (import ./lib {lib = final;}) prev;});
|
||||||
|
inherit
|
||||||
|
(extended-lib.elss)
|
||||||
|
discoverModules
|
||||||
|
moduleNames
|
||||||
|
discoverMachines
|
||||||
|
withModules
|
||||||
|
discoverTemplates
|
||||||
|
;
|
||||||
|
in
|
||||||
|
flake-utils-plus.lib.mkFlake rec {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
supportedSystems = ["x86_64-linux"];
|
||||||
|
|
||||||
lib = extended-lib;
|
lib = extended-lib;
|
||||||
|
|
||||||
@ -82,7 +92,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
channels.nixpkgs.overlaysBuilder = channels: [
|
channels.nixpkgs.overlaysBuilder = channels: [
|
||||||
(final: prev: { unstable = channels.nixpkgs-unstable; })
|
(final: prev: {unstable = channels.nixpkgs-unstable;})
|
||||||
(flake-utils-plus.lib.genPkgOverlay inputs.comma "comma")
|
(flake-utils-plus.lib.genPkgOverlay inputs.comma "comma")
|
||||||
#inputs.nix.overlay
|
#inputs.nix.overlay
|
||||||
inputs.emacs-overlay.overlay
|
inputs.emacs-overlay.overlay
|
||||||
@ -91,32 +101,38 @@
|
|||||||
hostDefaults = {
|
hostDefaults = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
channelName = "nixpkgs";
|
channelName = "nixpkgs";
|
||||||
modules = [
|
modules =
|
||||||
inputs.home-manager.nixosModules.home-manager
|
[
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.dwarffs.nixosModules.dwarffs
|
inputs.sops-nix.nixosModules.sops
|
||||||
inputs.simple-nixos-mailserver.nixosModules.mailserver
|
inputs.dwarffs.nixosModules.dwarffs
|
||||||
./common/wireguard.nix
|
inputs.simple-nixos-mailserver.nixosModules.mailserver
|
||||||
] ++ (map (name: ./modules + "/${name}") (moduleNames ./modules));
|
./common/wireguard.nix
|
||||||
|
]
|
||||||
|
++ (map (name: ./modules + "/${name}") (moduleNames ./modules));
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
nixos-hardware = inputs.nixos-hardware.nixosModules;
|
nixos-hardware = inputs.nixos-hardware.nixosModules;
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
};
|
};
|
||||||
extraArgs = {
|
extraArgs = {
|
||||||
homeConfigurations = withModules ./users ({ name, path, }:
|
homeConfigurations = withModules ./users ({
|
||||||
|
name,
|
||||||
|
path,
|
||||||
|
}:
|
||||||
#import (./users + "/${name}")
|
#import (./users + "/${name}")
|
||||||
import path);
|
import path);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hosts =
|
hosts =
|
||||||
discoverMachines ./machines { specialArgs = { lib = extended-lib; }; };
|
discoverMachines ./machines {specialArgs = {lib = extended-lib;};};
|
||||||
|
|
||||||
nixosModules = discoverModules ./modules;
|
nixosModules = discoverModules ./modules;
|
||||||
|
|
||||||
homeConfigurations = withModules ./users (name:
|
homeConfigurations = withModules ./users (name: let
|
||||||
let username = extended-lib.removeSuffix ".nix" name;
|
username = extended-lib.removeSuffix ".nix" name;
|
||||||
in inputs.home-manager.lib.homeManagerConfiguration {
|
in
|
||||||
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
configuration = import (./users + "/${name}");
|
configuration = import (./users + "/${name}");
|
||||||
inherit username;
|
inherit username;
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
@ -125,7 +141,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
outputsBuilder = channels: {
|
outputsBuilder = channels: {
|
||||||
devShells = let pkgs = channels.nixpkgs;
|
devShells = let
|
||||||
|
pkgs = channels.nixpkgs;
|
||||||
in rec {
|
in rec {
|
||||||
sops = import ./secrets/shell.nix {
|
sops = import ./secrets/shell.nix {
|
||||||
pkgs = channels.nixpkgs;
|
pkgs = channels.nixpkgs;
|
||||||
@ -164,14 +181,12 @@
|
|||||||
templates = discoverTemplates ./templates {
|
templates = discoverTemplates ./templates {
|
||||||
base = {
|
base = {
|
||||||
description = "Basic setup of tools in nixpkgs/unstable";
|
description = "Basic setup of tools in nixpkgs/unstable";
|
||||||
welcomeText =
|
welcomeText = "Change into the folder and add the wanted packages to the buildInputs";
|
||||||
"Change into the folder and add the wanted packages to the buildInputs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rust = {
|
rust = {
|
||||||
description = "Rust development environment flake";
|
description = "Rust development environment flake";
|
||||||
welcomeText =
|
welcomeText = "Change into the folder and follow the prompt to create an automatic rust environment in this folder";
|
||||||
"Change into the folder and follow the prompt to create an automatic rust environment in this folder";
|
|
||||||
};
|
};
|
||||||
jupyter = {
|
jupyter = {
|
||||||
description = "Jupyter server flake";
|
description = "Jupyter server flake";
|
||||||
|
|||||||
@ -1,14 +1,19 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }: {
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules =
|
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
|
||||||
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
boot.initrd.kernelModules = [];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.extraModulePackages = [];
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/da267a3c-34e3-4218-933f-10738ee61eb6";
|
device = "/dev/disk/by-uuid/da267a3c-34e3-4218-933f-10738ee61eb6";
|
||||||
@ -25,8 +30,7 @@
|
|||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [{device = "/dev/disk/by-uuid/0069f1fa-dd8e-4c0a-8f01-a576af29909e";}];
|
||||||
[{ device = "/dev/disk/by-uuid/0069f1fa-dd8e-4c0a-8f01-a576af29909e"; }];
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,30 +1,33 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }: {
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules =
|
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
|
||||||
[ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
boot.initrd.kernelModules = [];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.extraModulePackages = [];
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/6b7f9f80-af34-4317-b017-f883a2316674";
|
device = "/dev/disk/by-uuid/6b7f9f80-af34-4317-b017-f883a2316674";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.luks.devices."crypted".device =
|
boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/9c84f143-023d-4fcb-a49c-ca78ce69e0e0";
|
||||||
"/dev/disk/by-uuid/9c84f143-023d-4fcb-a49c-ca78ce69e0e0";
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/39E0-047B";
|
device = "/dev/disk/by-uuid/39E0-047B";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [{device = "/dev/disk/by-uuid/93381a25-6704-408e-b091-cfda6cddbda0";}];
|
||||||
[{ device = "/dev/disk/by-uuid/93381a25-6704-408e-b091-cfda6cddbda0"; }];
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,29 +1,36 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = config.elss.server.gitea;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = config.elss.server.gitea;
|
||||||
services.nginx.virtualHosts."git.ellmauthaler.net" = {
|
in
|
||||||
enableACME = true;
|
mkIf cfg.enable {
|
||||||
forceSSL = true;
|
services.nginx.virtualHosts."git.ellmauthaler.net" = {
|
||||||
locations."/" = { proxyPass = "http://localhost:3001"; };
|
enableACME = true;
|
||||||
};
|
forceSSL = true;
|
||||||
|
locations."/" = {proxyPass = "http://localhost:3001";};
|
||||||
services.gitea = {
|
|
||||||
enable = true;
|
|
||||||
settings.service = { DISABLE_REGISTRATION = true; };
|
|
||||||
appName = "gitea: ellmauthaler.net gitea service";
|
|
||||||
database = {
|
|
||||||
type = "postgres";
|
|
||||||
host = "/run/posgresql";
|
|
||||||
};
|
};
|
||||||
settings = {
|
|
||||||
repository = { DEFAULT_BRANCH = "main"; };
|
services.gitea = {
|
||||||
server = {
|
enable = true;
|
||||||
ROOT_URL = "https://git.ellmauthaler.net";
|
settings.service = {DISABLE_REGISTRATION = true;};
|
||||||
HTTP_PORT = 3001;
|
appName = "gitea: ellmauthaler.net gitea service";
|
||||||
DOMAIN = "git.ellmauthaler.net";
|
database = {
|
||||||
|
type = "postgres";
|
||||||
|
host = "/run/posgresql";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
repository = {DEFAULT_BRANCH = "main";};
|
||||||
|
server = {
|
||||||
|
ROOT_URL = "https://git.ellmauthaler.net";
|
||||||
|
HTTP_PORT = 3001;
|
||||||
|
DOMAIN = "git.ellmauthaler.net";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +1,47 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = config.elss.server.nextcloud;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = config.elss.server.nextcloud;
|
||||||
elss.server.sql.enable = mkDefault true;
|
in
|
||||||
services.nextcloud = {
|
mkIf cfg.enable {
|
||||||
enable = true;
|
elss.server.sql.enable = mkDefault true;
|
||||||
package = pkgs.nextcloud26;
|
services.nextcloud = {
|
||||||
hostName = "cloudstore.ellmauthaler.net";
|
enable = true;
|
||||||
https = true;
|
package = pkgs.nextcloud26;
|
||||||
enableBrokenCiphersForSSE = false;
|
hostName = "cloudstore.ellmauthaler.net";
|
||||||
config = {
|
https = true;
|
||||||
dbtype = "pgsql";
|
enableBrokenCiphersForSSE = false;
|
||||||
dbuser = "nextcloud";
|
config = {
|
||||||
dbname = "nextcloud";
|
dbtype = "pgsql";
|
||||||
adminuser = "storemin";
|
dbuser = "nextcloud";
|
||||||
adminpassFile = config.sops.secrets.storemin.path;
|
dbname = "nextcloud";
|
||||||
dbhost = "/run/postgresql";
|
adminuser = "storemin";
|
||||||
defaultPhoneRegion = "DE";
|
adminpassFile = config.sops.secrets.storemin.path;
|
||||||
|
dbhost = "/run/postgresql";
|
||||||
|
defaultPhoneRegion = "DE";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."cloudstore.ellmauthaler.net" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services."nextcloud-setup" = {
|
||||||
|
requires = ["postgresql.service"];
|
||||||
|
after = ["postrgresql.service"];
|
||||||
|
};
|
||||||
|
sops.secrets = {
|
||||||
|
storemin = {
|
||||||
|
owner = "nextcloud";
|
||||||
|
group = "nextcloud";
|
||||||
|
sopsFile = ../../secrets/server.yaml;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."cloudstore.ellmauthaler.net" = {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services."nextcloud-setup" = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postrgresql.service" ];
|
|
||||||
};
|
|
||||||
sops.secrets = {
|
|
||||||
storemin = {
|
|
||||||
owner = "nextcloud";
|
|
||||||
group = "nextcloud";
|
|
||||||
sopsFile = ../../secrets/server.yaml;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,22 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
options.elss.sshd.enable = mkEnableOption "Set up sshd";
|
options.elss.sshd.enable = mkEnableOption "Set up sshd";
|
||||||
|
|
||||||
config = let cfg = config.elss.sshd;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = config.elss.sshd;
|
||||||
services.openssh = {
|
in
|
||||||
enable = true;
|
mkIf cfg.enable {
|
||||||
settings = {
|
services.openssh = {
|
||||||
PasswordAuthentication = false;
|
enable = true;
|
||||||
PermitRootLogin = "no";
|
settings = {
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,33 +1,40 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = config.elss.graphical.xmonad;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = config.elss.graphical.xmonad;
|
||||||
elss.graphical.xserver = {
|
in
|
||||||
enable = true;
|
mkIf cfg.enable {
|
||||||
autorandr.enable = true;
|
elss.graphical.xserver = {
|
||||||
};
|
|
||||||
elss.users.dunst.enable = true;
|
|
||||||
elss.graphical.xmonad.polybar.enable = true;
|
|
||||||
services = {
|
|
||||||
xserver = {
|
|
||||||
windowManager.xmonad = {
|
|
||||||
enable = true;
|
|
||||||
enableContribAndExtras = true;
|
|
||||||
};
|
|
||||||
displayManager.defaultSession = "none+xmonad";
|
|
||||||
libinput = {
|
|
||||||
enable = true;
|
|
||||||
touchpad = { disableWhileTyping = true; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
upower.enable = true;
|
|
||||||
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
autorandr.enable = true;
|
||||||
pulse.enable = true;
|
|
||||||
};
|
};
|
||||||
|
elss.users.dunst.enable = true;
|
||||||
|
elss.graphical.xmonad.polybar.enable = true;
|
||||||
|
services = {
|
||||||
|
xserver = {
|
||||||
|
windowManager.xmonad = {
|
||||||
|
enable = true;
|
||||||
|
enableContribAndExtras = true;
|
||||||
|
};
|
||||||
|
displayManager.defaultSession = "none+xmonad";
|
||||||
|
libinput = {
|
||||||
|
enable = true;
|
||||||
|
touchpad = {disableWhileTyping = true;};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
upower.enable = true;
|
||||||
|
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages = with pkgs; [firefox thunderbird];
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [ firefox thunderbird ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,20 @@
|
|||||||
{ pkgs ? import <nixpkgs> { }, sops-nix ? pkgs.callPackage <sops-nix> { }
|
{
|
||||||
, name ? "secrets", ... }:
|
pkgs ? import <nixpkgs> {},
|
||||||
let
|
sops-nix ? pkgs.callPackage <sops-nix> {},
|
||||||
|
name ? "secrets",
|
||||||
|
...
|
||||||
|
}: let
|
||||||
sops-rekey = pkgs.writeShellScriptBin "sops-rekey" ''
|
sops-rekey = pkgs.writeShellScriptBin "sops-rekey" ''
|
||||||
${pkgs.findutils}/bin/find . -wholename '*/secrets/*.yaml' -exec ${pkgs.sops}/bin/sops updatekeys {} \;
|
${pkgs.findutils}/bin/find . -wholename '*/secrets/*.yaml' -exec ${pkgs.sops}/bin/sops updatekeys {} \;
|
||||||
'';
|
'';
|
||||||
in pkgs.mkShell {
|
in
|
||||||
sopsPGPKeyDirs = [ ./keys/users ./keys/hosts ];
|
pkgs.mkShell {
|
||||||
name = name;
|
sopsPGPKeyDirs = [./keys/users ./keys/hosts];
|
||||||
nativeBuildInputs = [
|
name = name;
|
||||||
sops-nix.sops-import-keys-hook
|
nativeBuildInputs = [
|
||||||
sops-nix.ssh-to-pgp
|
sops-nix.sops-import-keys-hook
|
||||||
sops-rekey
|
sops-nix.ssh-to-pgp
|
||||||
pkgs.wireguard-tools
|
sops-rekey
|
||||||
];
|
pkgs.wireguard-tools
|
||||||
}
|
];
|
||||||
|
}
|
||||||
|
|||||||
@ -8,18 +8,24 @@
|
|||||||
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils, flake-utils-plus
|
outputs = {
|
||||||
, ... }@inputs:
|
self,
|
||||||
{ } // (flake-utils.lib.eachDefaultSystem (system:
|
nixpkgs,
|
||||||
let
|
nixpkgs-unstable,
|
||||||
unstable = import nixpkgs-unstable { inherit system; };
|
flake-utils,
|
||||||
pkgs = import nixpkgs { inherit system; };
|
flake-utils-plus,
|
||||||
in rec {
|
...
|
||||||
devShell = pkgs.mkShell {
|
} @ inputs:
|
||||||
buildInputs = [
|
{}
|
||||||
# add packages here, like
|
// (flake-utils.lib.eachDefaultSystem (system: let
|
||||||
# pkgs.clingo
|
unstable = import nixpkgs-unstable {inherit system;};
|
||||||
];
|
pkgs = import nixpkgs {inherit system;};
|
||||||
};
|
in rec {
|
||||||
}));
|
devShell = pkgs.mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
# add packages here, like
|
||||||
|
# pkgs.clingo
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,33 +18,40 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils, gitignoresrc
|
outputs = {
|
||||||
, rust-overlay, ... }@inputs:
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
flake-utils,
|
||||||
|
gitignoresrc,
|
||||||
|
rust-overlay,
|
||||||
|
...
|
||||||
|
} @ inputs:
|
||||||
{
|
{
|
||||||
#overlay = import ./nix { inherit gitignoresrc; };
|
#overlay = import ./nix { inherit gitignoresrc; };
|
||||||
} // (flake-utils.lib.eachDefaultSystem (system:
|
}
|
||||||
let
|
// (flake-utils.lib.eachDefaultSystem (system: let
|
||||||
unstable = import nixpkgs-unstable { inherit system; };
|
unstable = import nixpkgs-unstable {inherit system;};
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ (import rust-overlay) ];
|
overlays = [(import rust-overlay)];
|
||||||
};
|
};
|
||||||
in rec {
|
in rec {
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
RUST_LOG = "debug";
|
RUST_LOG = "debug";
|
||||||
RUST_BACKTRACE = 1;
|
RUST_BACKTRACE = 1;
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.rust-bin.stable.latest.rustfmt
|
pkgs.rust-bin.stable.latest.rustfmt
|
||||||
pkgs.rust-bin.stable.latest.default
|
pkgs.rust-bin.stable.latest.default
|
||||||
pkgs.rust-analyzer
|
pkgs.rust-analyzer
|
||||||
pkgs.cargo-audit
|
pkgs.cargo-audit
|
||||||
pkgs.cargo-license
|
pkgs.cargo-license
|
||||||
pkgs.cargo-tarpaulin
|
pkgs.cargo-tarpaulin
|
||||||
pkgs.cargo-kcov
|
pkgs.cargo-kcov
|
||||||
pkgs.valgrind
|
pkgs.valgrind
|
||||||
pkgs.gnuplot
|
pkgs.gnuplot
|
||||||
pkgs.kcov
|
pkgs.kcov
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,134 +1,132 @@
|
|||||||
{ config, pkgs, lib, nixosConfig, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nixosConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = nixosConfig.elss.graphical.xserver.autorandr;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = nixosConfig.elss.graphical.xserver.autorandr;
|
||||||
#services.autorandr = { enable = true; };
|
in
|
||||||
programs.autorandr = {
|
mkIf cfg.enable {
|
||||||
enable = true;
|
#services.autorandr = { enable = true; };
|
||||||
profiles = {
|
programs.autorandr = {
|
||||||
"home" = {
|
enable = true;
|
||||||
fingerprint = {
|
profiles = {
|
||||||
DP-1 =
|
"home" = {
|
||||||
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
fingerprint = {
|
||||||
eDP-1 =
|
DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
eDP-1.enable = false;
|
eDP-1.enable = false;
|
||||||
DP-1 = {
|
DP-1 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
crtc = 1;
|
crtc = 1;
|
||||||
primary = true;
|
primary = true;
|
||||||
position = "0x0";
|
position = "0x0";
|
||||||
mode = "3840x2160";
|
mode = "3840x2160";
|
||||||
dpi = 96;
|
dpi = 96;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
"mobile" = {
|
||||||
"mobile" = {
|
fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
fingerprint.eDP-1 =
|
config = {
|
||||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
eDP-1 = {
|
||||||
config = {
|
enable = true;
|
||||||
eDP-1 = {
|
primary = true;
|
||||||
enable = true;
|
mode = "3840x2160";
|
||||||
primary = true;
|
dpi = 192;
|
||||||
mode = "3840x2160";
|
};
|
||||||
dpi = 192;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
"work" = {
|
||||||
"work" = {
|
fingerprint = {
|
||||||
fingerprint = {
|
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
eDP-1 =
|
DP-2 = "00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
||||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
|
||||||
DP-2 =
|
|
||||||
"00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
eDP-1 = {
|
|
||||||
enable = true;
|
|
||||||
crtc = 0;
|
|
||||||
position = "3840x0";
|
|
||||||
mode = "3840x2160";
|
|
||||||
#dpi = 288;
|
|
||||||
dpi = 96;
|
|
||||||
};
|
};
|
||||||
DP-2 = {
|
config = {
|
||||||
enable = true;
|
eDP-1 = {
|
||||||
primary = true;
|
enable = true;
|
||||||
mode = "3840x2160";
|
crtc = 0;
|
||||||
#dpi = 144;
|
position = "3840x0";
|
||||||
dpi = 96;
|
mode = "3840x2160";
|
||||||
position = "0x0";
|
#dpi = 288;
|
||||||
|
dpi = 96;
|
||||||
|
};
|
||||||
|
DP-2 = {
|
||||||
|
enable = true;
|
||||||
|
primary = true;
|
||||||
|
mode = "3840x2160";
|
||||||
|
#dpi = 144;
|
||||||
|
dpi = 96;
|
||||||
|
position = "0x0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
"home-nuc" = {
|
||||||
"home-nuc" = {
|
fingerprint = {
|
||||||
fingerprint = {
|
DP-2 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||||
DP-2 =
|
};
|
||||||
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
config = {
|
||||||
};
|
DP-2 = {
|
||||||
config = {
|
enable = true;
|
||||||
DP-2 = {
|
crtc = 1;
|
||||||
enable = true;
|
primary = true;
|
||||||
crtc = 1;
|
position = "0x0";
|
||||||
primary = true;
|
mode = "3840x2160";
|
||||||
position = "0x0";
|
dpi = 96;
|
||||||
mode = "3840x2160";
|
};
|
||||||
dpi = 96;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"e3027" = {
|
"e3027" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
e-DP1 =
|
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||||
DP-1 =
|
|
||||||
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
eDP-1 = {
|
|
||||||
enable = true;
|
|
||||||
crtc = 0;
|
|
||||||
position = "0x0";
|
|
||||||
mode = "3840x2160";
|
|
||||||
};
|
};
|
||||||
DP-1 = {
|
config = {
|
||||||
enable = true;
|
eDP-1 = {
|
||||||
crtc = 1;
|
enable = true;
|
||||||
position = "3840x0";
|
crtc = 0;
|
||||||
mode = "1920x1200";
|
position = "0x0";
|
||||||
|
mode = "3840x2160";
|
||||||
|
};
|
||||||
|
DP-1 = {
|
||||||
|
enable = true;
|
||||||
|
crtc = 1;
|
||||||
|
position = "3840x0";
|
||||||
|
mode = "1920x1200";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"e3027-clone" = {
|
"e3027-clone" = {
|
||||||
fingerprint = {
|
fingerprint = {
|
||||||
e-DP1 =
|
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||||
DP-1 =
|
|
||||||
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
eDP-1 = {
|
|
||||||
enable = true;
|
|
||||||
crtc = 0;
|
|
||||||
position = "0x0";
|
|
||||||
mode = "1920x1200";
|
|
||||||
};
|
};
|
||||||
DP-1 = {
|
config = {
|
||||||
enable = true;
|
eDP-1 = {
|
||||||
crtc = 1;
|
enable = true;
|
||||||
position = "0x0";
|
crtc = 0;
|
||||||
mode = "1920x1200";
|
position = "0x0";
|
||||||
|
mode = "1920x1200";
|
||||||
|
};
|
||||||
|
DP-1 = {
|
||||||
|
enable = true;
|
||||||
|
crtc = 1;
|
||||||
|
position = "0x0";
|
||||||
|
mode = "1920x1200";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
hooks.postswitch = {
|
||||||
hooks.postswitch = {
|
"polybar" = "systemctl --user restart polybar.service";
|
||||||
"polybar" = "systemctl --user restart polybar.service";
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +1,48 @@
|
|||||||
{ config, pkgs, lib, nixosConfig, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nixosConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = nixosConfig.elss.users.dunst;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = nixosConfig.elss.users.dunst;
|
||||||
services.dunst = {
|
in
|
||||||
iconTheme = {
|
mkIf cfg.enable {
|
||||||
package = pkgs.numix-icon-theme;
|
services.dunst = {
|
||||||
name = "Numix";
|
iconTheme = {
|
||||||
size = "26";
|
package = pkgs.numix-icon-theme;
|
||||||
};
|
name = "Numix";
|
||||||
settings = {
|
size = "26";
|
||||||
global = {
|
|
||||||
geometry = "800x5-30+50";
|
|
||||||
transparency = 10;
|
|
||||||
frame_color = "#839496";
|
|
||||||
font = "Hasklug Nerd Font 11";
|
|
||||||
timeout = 5;
|
|
||||||
follow = "mouse";
|
|
||||||
markup = "full";
|
|
||||||
icon_position = "left";
|
|
||||||
history_length = 32;
|
|
||||||
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
|
|
||||||
word_wrap = true;
|
|
||||||
};
|
};
|
||||||
urgency_critical = {
|
settings = {
|
||||||
foreground = "#fdf6e3";
|
global = {
|
||||||
background = "#dc322f";
|
geometry = "800x5-30+50";
|
||||||
};
|
transparency = 10;
|
||||||
urgency_normal = {
|
frame_color = "#839496";
|
||||||
foreground = "#fdf6e3";
|
font = "Hasklug Nerd Font 11";
|
||||||
background = "#859900";
|
timeout = 5;
|
||||||
};
|
follow = "mouse";
|
||||||
urgency_low = {
|
markup = "full";
|
||||||
foreground = "#fdf6e3";
|
icon_position = "left";
|
||||||
background = "#2aa198";
|
history_length = 32;
|
||||||
|
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
|
||||||
|
word_wrap = true;
|
||||||
|
};
|
||||||
|
urgency_critical = {
|
||||||
|
foreground = "#fdf6e3";
|
||||||
|
background = "#dc322f";
|
||||||
|
};
|
||||||
|
urgency_normal = {
|
||||||
|
foreground = "#fdf6e3";
|
||||||
|
background = "#859900";
|
||||||
|
};
|
||||||
|
urgency_low = {
|
||||||
|
foreground = "#fdf6e3";
|
||||||
|
background = "#2aa198";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,132 +1,138 @@
|
|||||||
{ config, pkgs, lib, nixosConfig, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nixosConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
||||||
services.polybar = {
|
in
|
||||||
enable = true;
|
mkIf cfg.enable {
|
||||||
package = pkgs.polybarFull;
|
services.polybar = {
|
||||||
settings = let
|
enable = true;
|
||||||
fonts = [
|
package = pkgs.polybarFull;
|
||||||
"Weather Icons:size=12;0"
|
settings = let
|
||||||
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
fonts = [
|
||||||
"all-the-icons:style=Regular"
|
"Weather Icons:size=12;0"
|
||||||
"Webdings:style=Regular"
|
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
||||||
"Noto Emoji:scale=10"
|
"all-the-icons:style=Regular"
|
||||||
"Unifont:style=Regular"
|
"Webdings:style=Regular"
|
||||||
"Material Icons:size=12;0"
|
"Noto Emoji:scale=10"
|
||||||
];
|
"Unifont:style=Regular"
|
||||||
in {
|
"Material Icons:size=12;0"
|
||||||
"bar/main" = {
|
];
|
||||||
font = fonts;
|
in {
|
||||||
modules = {
|
"bar/main" = {
|
||||||
left = "xmonad";
|
font = fonts;
|
||||||
center = "";
|
modules = {
|
||||||
# right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
left = "xmonad";
|
||||||
right = "xkeyboard dunst battery date volume";
|
center = "";
|
||||||
};
|
# right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
||||||
tray = {
|
right = "xkeyboard dunst battery date volume";
|
||||||
position = "right";
|
};
|
||||||
padding = 3;
|
tray = {
|
||||||
|
position = "right";
|
||||||
|
padding = 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
# background = "FFFFFF";
|
||||||
|
# foreground = "000000";
|
||||||
|
|
||||||
|
module-margin = 2;
|
||||||
|
|
||||||
|
monitor = ''
|
||||||
|
''${env:MONITOR:}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# background = "FFFFFF";
|
"bar/aux" = {
|
||||||
# foreground = "000000";
|
font = fonts;
|
||||||
|
modules = {
|
||||||
module-margin = 2;
|
left = "xmonad";
|
||||||
|
center = "";
|
||||||
monitor = ''
|
right = "";
|
||||||
''${env:MONITOR:}
|
};
|
||||||
'';
|
monitor = ''
|
||||||
};
|
''${env:MONITOR:}
|
||||||
|
'';
|
||||||
"bar/aux" = {
|
};
|
||||||
font = fonts;
|
|
||||||
modules = {
|
"module/xmonad" = {
|
||||||
left = "xmonad";
|
type = "custom/script";
|
||||||
center = "";
|
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
|
||||||
right = "";
|
tail = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"module/dunst" = {
|
||||||
|
type = "custom/script";
|
||||||
|
exec = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q true && echo || echo ";
|
||||||
|
interval = 10;
|
||||||
|
click-left = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
||||||
|
};
|
||||||
|
|
||||||
|
"module/volume" = {
|
||||||
|
type = "internal/pulseaudio";
|
||||||
|
format.volume = "<ramp-volume> <label-volume>";
|
||||||
|
label.muted.text = "🔇";
|
||||||
|
label.muted.foreground = "#666";
|
||||||
|
ramp.volume = ["🔈" "🔉" "🔊"];
|
||||||
|
click.right = "${pkgs.pavucontrol}/bin/pavucontrol &";
|
||||||
|
# format-volume-underline = Base2;
|
||||||
|
# format-muted-underline = Base2;
|
||||||
|
};
|
||||||
|
|
||||||
|
"module/xkeyboard" = {
|
||||||
|
type = "internal/xkeyboard";
|
||||||
|
blacklist-0 = "num lock";
|
||||||
|
interval = "5";
|
||||||
|
format-prefix = ''""'';
|
||||||
|
label-layout = "%layout%";
|
||||||
|
label-indicator-padding = "2";
|
||||||
|
label-indicator-margin = "1";
|
||||||
|
};
|
||||||
|
|
||||||
|
"module/battery" = {
|
||||||
|
type = "internal/battery";
|
||||||
|
battery = "BAT0";
|
||||||
|
adapter = "ADP1";
|
||||||
|
full-at = "98";
|
||||||
|
format-charging-prefix = ''" "'';
|
||||||
|
format-charging = "<label-charging>";
|
||||||
|
format-discharging-prefix = ''" "'';
|
||||||
|
format-discharging = "<label-discharging>";
|
||||||
|
format-full-prefix = ''" "'';
|
||||||
|
format-full-padding = "1";
|
||||||
|
format-charging-padding = "1";
|
||||||
|
format-discharging-padding = "1";
|
||||||
|
};
|
||||||
|
|
||||||
|
"module/date" = {
|
||||||
|
type = "internal/date";
|
||||||
|
interval = "5";
|
||||||
|
|
||||||
|
date = ''" %Y-%m-%d"'';
|
||||||
|
date-alt = ''" %Y-%m-%d"'';
|
||||||
|
|
||||||
|
time = "%H:%M";
|
||||||
|
time-alt = "%H:%M:%S";
|
||||||
|
|
||||||
|
label = "%{A} %date% %time%";
|
||||||
};
|
};
|
||||||
monitor = ''
|
|
||||||
''${env:MONITOR:}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/xmonad" = {
|
|
||||||
type = "custom/script";
|
|
||||||
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
|
|
||||||
tail = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/dunst" = {
|
|
||||||
type = "custom/script";
|
|
||||||
exec =
|
|
||||||
"PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q true && echo || echo ";
|
|
||||||
interval = 10;
|
|
||||||
click-left =
|
|
||||||
"PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/volume" = {
|
|
||||||
type = "internal/pulseaudio";
|
|
||||||
format.volume = "<ramp-volume> <label-volume>";
|
|
||||||
label.muted.text = "🔇";
|
|
||||||
label.muted.foreground = "#666";
|
|
||||||
ramp.volume = [ "🔈" "🔉" "🔊" ];
|
|
||||||
click.right = "${pkgs.pavucontrol}/bin/pavucontrol &";
|
|
||||||
# format-volume-underline = Base2;
|
|
||||||
# format-muted-underline = Base2;
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/xkeyboard" = {
|
|
||||||
type = "internal/xkeyboard";
|
|
||||||
blacklist-0 = "num lock";
|
|
||||||
interval = "5";
|
|
||||||
format-prefix = ''""'';
|
|
||||||
label-layout = "%layout%";
|
|
||||||
label-indicator-padding = "2";
|
|
||||||
label-indicator-margin = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/battery" = {
|
|
||||||
type = "internal/battery";
|
|
||||||
battery = "BAT0";
|
|
||||||
adapter = "ADP1";
|
|
||||||
full-at = "98";
|
|
||||||
format-charging-prefix = ''" "'';
|
|
||||||
format-charging = "<label-charging>";
|
|
||||||
format-discharging-prefix = ''" "'';
|
|
||||||
format-discharging = "<label-discharging>";
|
|
||||||
format-full-prefix = ''" "'';
|
|
||||||
format-full-padding = "1";
|
|
||||||
format-charging-padding = "1";
|
|
||||||
format-discharging-padding = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
"module/date" = {
|
|
||||||
type = "internal/date";
|
|
||||||
interval = "5";
|
|
||||||
|
|
||||||
date = ''" %Y-%m-%d"'';
|
|
||||||
date-alt = ''" %Y-%m-%d"'';
|
|
||||||
|
|
||||||
time = "%H:%M";
|
|
||||||
time-alt = "%H:%M:%S";
|
|
||||||
|
|
||||||
label = "%{A} %date% %time%";
|
|
||||||
};
|
};
|
||||||
|
script = ''
|
||||||
|
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||||
|
MONITOR=$m polybar --reload main &
|
||||||
|
done;
|
||||||
|
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||||
|
MONITOR=$m polybar --reload aux &
|
||||||
|
done;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
script = ''
|
|
||||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
|
||||||
MONITOR=$m polybar --reload main &
|
|
||||||
done;
|
|
||||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
|
||||||
MONITOR=$m polybar --reload aux &
|
|
||||||
done;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.polybar = {
|
systemd.user.services.polybar = {
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = ["graphical-session.target"];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,39 +1,46 @@
|
|||||||
{ config, pkgs, lib, nixosConfig, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nixosConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config = let cfg = nixosConfig.elss.graphical.xmonad;
|
config = let
|
||||||
in mkIf cfg.enable {
|
cfg = nixosConfig.elss.graphical.xmonad;
|
||||||
xsession = {
|
in
|
||||||
windowManager.xmonad = {
|
mkIf cfg.enable {
|
||||||
enable = true;
|
xsession = {
|
||||||
enableContribAndExtras = true;
|
windowManager.xmonad = {
|
||||||
extraPackages = hp: [
|
enable = true;
|
||||||
hp.dbus
|
enableContribAndExtras = true;
|
||||||
hp.hostname
|
extraPackages = hp: [
|
||||||
hp.monad-logger
|
hp.dbus
|
||||||
hp.xmonad-contrib
|
hp.hostname
|
||||||
];
|
hp.monad-logger
|
||||||
libFiles."ELSS.hs" = pkgs.writeText "ELSS.hs" ''
|
hp.xmonad-contrib
|
||||||
module ELSS where
|
];
|
||||||
keyboardtoggle = "${conf/keyboard/keyboard_layout_toggle.sh}"
|
libFiles."ELSS.hs" = pkgs.writeText "ELSS.hs" ''
|
||||||
'';
|
module ELSS where
|
||||||
config = conf/xmonad/xmonad.hs;
|
keyboardtoggle = "${conf/keyboard/keyboard_layout_toggle.sh}"
|
||||||
|
'';
|
||||||
|
config = conf/xmonad/xmonad.hs;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
betterlockscreen = {
|
||||||
|
enable = true;
|
||||||
|
inactiveInterval = 10;
|
||||||
|
};
|
||||||
|
picom = {
|
||||||
|
enable = true;
|
||||||
|
backend = "glx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gtk.enable = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [rofi polybarFull firefox pulseaudioFull];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
|
||||||
betterlockscreen = {
|
|
||||||
enable = true;
|
|
||||||
inactiveInterval = 10;
|
|
||||||
};
|
|
||||||
picom = {
|
|
||||||
enable = true;
|
|
||||||
backend = "glx";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
gtk.enable = true;
|
|
||||||
|
|
||||||
home.packages = with pkgs; [ rofi polybarFull firefox pulseaudioFull ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user