Modularize scripts
This commit is contained in:
parent
96b410a358
commit
225da437c5
30 changed files with 590 additions and 423 deletions
48
README.md
48
README.md
|
|
@ -34,35 +34,64 @@ nixosConfigurations = (inputs.dashNix.dashNixLib.build_systems [
|
|||
```
|
||||
|
||||
In order for your configuration to work, you are required to at least provide a single config file with a further config file being optional for custom configuration.
|
||||
The hardware.nix specifies additional NixOS configuration, while home.nix specifies additional home-manager configuration. (both optional)
|
||||
|
||||
|- flake.nix\
|
||||
|- flake.lock\
|
||||
|- system1/\
|
||||
|---- system1.nix (required)\
|
||||
|---- configuration.nix (optional)\
|
||||
|---- configuration.nix (required)\
|
||||
|---- hardware.nix (optional)\
|
||||
|---- home.nix (optional)
|
||||
|- system2/\
|
||||
|---- system2.nix (required)\
|
||||
|---- configuration.nix (optional)\
|
||||
|---- configuration.nix (required)\
|
||||
|---- hardware.nix (optional)\
|
||||
|---- home.nix (optional)
|
||||
|- system3/\
|
||||
|---- system3.nix (required)\
|
||||
|---- configuration.nix (optional)
|
||||
|---- configuration.nix (required)
|
||||
|---- hardware.nix (optional)\
|
||||
|---- home.nix (optional)
|
||||
|
||||
Here is a minimal required configuration.nix (the TODOs mention a required change):
|
||||
|
||||
Here is a minimal required configuration (the TODOs mention a required change):
|
||||
```nix
|
||||
{
|
||||
# variables for system
|
||||
# TODO important changes
|
||||
conf = {
|
||||
# TODO change this to your monitor and your pc name
|
||||
# change this to your monitor and your pc name
|
||||
# should be something like DP-1
|
||||
monitor = "YOURMONITOR";
|
||||
# your username
|
||||
username = "YOURNAME";
|
||||
# the name of your system
|
||||
hostname = "YOURNAME";
|
||||
# TODO only needed when you use intel -> amd is default
|
||||
# cpu = "intel";
|
||||
locale = "something.UTF-8";
|
||||
timezone = "CONTINENT/CITY";
|
||||
};
|
||||
# modules
|
||||
mods = {
|
||||
# default disk config has root home boot and swap partition, overwrite if you want something different
|
||||
defaultDrives.enable = false;
|
||||
extraDrives = [
|
||||
{
|
||||
name = "boot";
|
||||
drive = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "";
|
||||
drive = {
|
||||
device = "/dev/disk/by-label/ROOT";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
};
|
||||
}
|
||||
];
|
||||
sops.enable = false;
|
||||
nextcloud.enable = false;
|
||||
hyprland.monitor = [
|
||||
|
|
@ -81,6 +110,8 @@ Here is a minimal required configuration (the TODOs mention a required change):
|
|||
};
|
||||
}
|
||||
```
|
||||
## First Login
|
||||
After logging in the first time, your password will be set to "firstlogin", please change this to whatever you like.
|
||||
|
||||
# Modules
|
||||
|
||||
|
|
@ -118,3 +149,4 @@ For package lists, please check the individual modules, as the lists can be long
|
|||
- sops: Enables sops-nix
|
||||
- fish: Enables and configures fish shell
|
||||
- kitty: Enables and configures kitty terminal
|
||||
- oxi: My own programs, can be selectively disabled, or as a whole
|
||||
|
|
|
|||
|
|
@ -4,28 +4,49 @@ in {
|
|||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot = {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.plymouth = { enable = true; };
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
plymouth = { enable = true; };
|
||||
kernelPackages = config.conf.kernel;
|
||||
initrd.availableKernelModules =
|
||||
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
kernelParams = [ ''resume="PARTLABEL=SWAP"'' ] ++ config.conf.boot_params;
|
||||
};
|
||||
|
||||
# Enable networking
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
networking.networkmanager.enable = true;
|
||||
networking.hostName = config.conf.hostname;
|
||||
|
||||
services.flatpak.enable = true;
|
||||
networking = {
|
||||
useDHCP = lib.mkDefault true;
|
||||
networkmanager.enable = true;
|
||||
hostName = config.conf.hostname;
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Zurich";
|
||||
time.timeZone = config.conf.timezone;
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.defaultLocale = config.conf.locale;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
services = {
|
||||
flatpak.enable = true;
|
||||
xserver.enable = true;
|
||||
fstrim.enable = lib.mkDefault true;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
jack.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault config.conf.system;
|
||||
nix = {
|
||||
|
|
@ -43,33 +64,23 @@ in {
|
|||
};
|
||||
|
||||
# Enable sound with pipewire.
|
||||
hardware.pulseaudio.enable = false;
|
||||
hardware.cpu.${config.conf.cpu}.updateMicrocode =
|
||||
hardware = {
|
||||
pulseaudio.enable = false;
|
||||
cpu.${config.conf.cpu}.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
services.fstrim.enable = lib.mkDefault true;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
security.rtkit.enable = true;
|
||||
|
||||
environment.variables = {
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
};
|
||||
|
||||
boot.kernelPackages = config.conf.kernel;
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.kernelParams = [ ''resume="PARTLABEL=SWAP"'' ]
|
||||
++ config.conf.boot_params;
|
||||
|
||||
# allows user change later on
|
||||
users.mutableUsers = true;
|
||||
users.users.${username} = {
|
||||
users = {
|
||||
mutableUsers = true;
|
||||
users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = username;
|
||||
extraGroups = [
|
||||
|
|
@ -86,5 +97,6 @@ in {
|
|||
# e.g. login, then change to whatever else, this also ensures no public hash is available
|
||||
password = "firstlogin";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, config, ... }: {
|
||||
environment.variables = {
|
||||
environment = {
|
||||
variables = {
|
||||
GSETTINGS_SCHEMA_DIR =
|
||||
"${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
|
||||
NEOVIDE_MAXIMIZED = "0";
|
||||
|
|
@ -8,9 +9,10 @@
|
|||
SUDO_EDITOR = "neovide --no-fork";
|
||||
SCRIPTS = "$HOME/.config/scripts";
|
||||
};
|
||||
environment.sessionVariables = {
|
||||
sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
GOPATH = "$HOME/.go";
|
||||
FLAKE = config.conf.nix_path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,26 @@
|
|||
{
|
||||
# variables for system
|
||||
# TODO important changes
|
||||
conf = {
|
||||
# TODO change this to your monitor and your pc name
|
||||
# change this to your monitor and your pc name
|
||||
# should be something like DP-1
|
||||
monitor = "YOURMONITOR";
|
||||
# your username
|
||||
username = "YOURNAME";
|
||||
# the name of your system
|
||||
hostname = "YOURNAME";
|
||||
# TODO only needed when you use intel -> amd is default
|
||||
# cpu = "intel";
|
||||
locale = "something.UTF-8";
|
||||
timezone = "CONTINENT/CITY";
|
||||
};
|
||||
# modules
|
||||
mods = {
|
||||
# default disk config has root home boot and swap partition, overwrite if you want something different
|
||||
defaultDrives.enable = false;
|
||||
extraDrives = [
|
||||
{
|
||||
name = "/boot";
|
||||
name = "boot";
|
||||
drive = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
|
|
@ -23,7 +28,7 @@
|
|||
};
|
||||
}
|
||||
{
|
||||
name = "/root";
|
||||
name = "";
|
||||
drive = {
|
||||
device = "/dev/disk/by-label/ROOT";
|
||||
fsType = "ext4";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ inputs, pkgs, config, lib, mod, ... }:
|
||||
{ inputs, pkgs, config, lib, mod, additionalHomeConfig, ... }:
|
||||
let
|
||||
base_imports = [
|
||||
inputs.anyrun.homeManagerModules.default
|
||||
|
|
@ -16,7 +16,6 @@ let
|
|||
inputs.dashvim.homeManagerModules.dashvim
|
||||
../modules
|
||||
];
|
||||
usernamePassed = config.conf.username;
|
||||
in {
|
||||
xdg = {
|
||||
portal.config.common.default = "*";
|
||||
|
|
@ -30,14 +29,11 @@ in {
|
|||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
|
||||
users.${usernamePassed} = {
|
||||
imports = [
|
||||
./common.nix
|
||||
./xdg.nix
|
||||
./oxi/default.nix
|
||||
./themes/default.nix
|
||||
./sync.nix
|
||||
] ++ base_imports ++ lib.optional (builtins.pathExists mod) mod;
|
||||
users.${config.conf.username} = {
|
||||
imports = [ ./common.nix ./xdg.nix ./themes ./sync.nix ] ++ base_imports
|
||||
++ lib.optional (builtins.pathExists mod) mod
|
||||
++ lib.optional (builtins.pathExists additionalHomeConfig)
|
||||
additionalHomeConfig;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -6,18 +6,19 @@ in {
|
|||
name = name;
|
||||
value = let
|
||||
mod = root + /${name}/configuration.nix;
|
||||
additionalConfig = root + /${name}/${name}.nix;
|
||||
additionalNixosConfig = root + /${name}/hardware.nix;
|
||||
additionalHomeConfig = root + /${name}/home.nix;
|
||||
in inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs pkgs mod; };
|
||||
specialArgs = { inherit inputs pkgs mod additionalHomeConfig; };
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.stylix.nixosModules.stylix
|
||||
../base
|
||||
../programs
|
||||
../home
|
||||
../modules
|
||||
mod
|
||||
] ++ inputs.nixpkgs.lib.optional (builtins.pathExists additionalConfig)
|
||||
additionalConfig
|
||||
] ++ inputs.nixpkgs.lib.optional
|
||||
(builtins.pathExists additionalNixosConfig) additionalNixosConfig
|
||||
++ inputs.nixpkgs.lib.optional (builtins.pathExists mod) mod;
|
||||
};
|
||||
}) systems);
|
||||
|
|
|
|||
|
|
@ -101,6 +101,24 @@
|
|||
'';
|
||||
};
|
||||
|
||||
timezone = lib.mkOption {
|
||||
default = "Europe/Zurich";
|
||||
example = "Europe/Berlin";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The timezone.
|
||||
'';
|
||||
};
|
||||
|
||||
locale = lib.mkOption {
|
||||
default = "en_US.UTF-8";
|
||||
example = "de_DE.UTF-8";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The locale.
|
||||
'';
|
||||
};
|
||||
|
||||
nixos-config-path = lib.mkOption {
|
||||
default = "/home/${config.conf.username}/gits/nixos/.";
|
||||
example = "yourpath/.";
|
||||
|
|
|
|||
|
|
@ -17,12 +17,15 @@
|
|||
./hyprland
|
||||
./kde_connect.nix
|
||||
./keepassxc.nix
|
||||
./kitty.nix
|
||||
./layout.nix
|
||||
./media.nix
|
||||
./ncspot.nix
|
||||
./nextcloud.nix
|
||||
./oxi
|
||||
./piper.nix
|
||||
./printing.nix
|
||||
./scripts.nix
|
||||
./sops.nix
|
||||
./starship.nix
|
||||
./stylix.nix
|
||||
|
|
@ -30,6 +33,5 @@
|
|||
./virtualbox.nix
|
||||
./xone.nix
|
||||
./yazi
|
||||
./kitty.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,12 +69,8 @@
|
|||
|
||||
#my own programs
|
||||
programs = {
|
||||
oxicalc.enable = true;
|
||||
oxinoti.enable = true;
|
||||
oxidash.enable = true;
|
||||
oxishut.enable = true;
|
||||
oxipaste.enable = true;
|
||||
hyprdock.enable = true;
|
||||
oxicalc.enable = true;
|
||||
ReSet.enable = true;
|
||||
ReSet.config.plugins = [
|
||||
inputs.reset-plugins.packages."x86_64-linux".monitor
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
{ config, lib, options, pkgs, ... }: {
|
||||
imports = [
|
||||
|
||||
];
|
||||
|
||||
options.mods = {
|
||||
hyprland = {
|
||||
enable = lib.mkOption {
|
||||
|
|
@ -92,11 +88,9 @@
|
|||
bind = [
|
||||
# screenshots
|
||||
''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy''
|
||||
''
|
||||
$mod SUPERSHIFTALT,S,exec, grim -g "$(slurp)" $HOME/gits/ost-5semester/Screenshots/$(date +'%Y_%m_%d_%I_%M_%S.png') && (date +'%Y_%m_%d_%I_%M_%S.png') | wl-copy''
|
||||
''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -''
|
||||
''
|
||||
$mod SUPERCONTROLSHIFT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
|
||||
$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
|
||||
|
||||
# regular programs
|
||||
"$mod SUPER,F,exec,firefox"
|
||||
|
|
@ -114,14 +108,19 @@
|
|||
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
|
||||
|
||||
# media keys
|
||||
",XF86AudioMute,exec, $HOME/.config/scripts/audio_control.sh mute"
|
||||
",XF86AudioLowerVolume,exec, $HOME/.config/scripts/audio_control.sh sink -5%"
|
||||
",XF86AudioRaiseVolume,exec, $HOME/.config/scripts/audio_control.sh sink +5%"
|
||||
(lib.mkIf config.mods.scripts.audio-control
|
||||
",XF86AudioMute,exec, audio-control mute")
|
||||
(lib.mkIf config.mods.scripts.audio-control
|
||||
",XF86AudioLowerVolume,exec, audio-control sink -5%")
|
||||
(lib.mkIf config.mods.scripts.audio-control
|
||||
",XF86AudioRaiseVolume,exec, audio-control sink +5%")
|
||||
",XF86AudioPlay,exec, playerctl play-pause"
|
||||
",XF86AudioNext,exec, playerctl next"
|
||||
",XF86AudioPrev,exec, playerctl previous"
|
||||
",XF86MonBrightnessDown,exec, $HOME/.config/scripts/change-brightness brightness 10%-"
|
||||
",XF86MonBrightnessUp,exec, $HOME/.config/scripts/change-brightness brightness +10%"
|
||||
(lib.mkIf config.mods.scripts.change-brightness
|
||||
",XF86MonBrightnessDown,exec, change-brightness brightness 10%-")
|
||||
(lib.mkIf config.mods.scripts.change-brightness
|
||||
",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
|
||||
|
||||
# hyprland keybinds
|
||||
# misc
|
||||
|
|
|
|||
57
modules/programs/oxi/default.nix
Normal file
57
modules/programs/oxi/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ lib, config, options, inputs, ... }: {
|
||||
imports = [ ./oxidash.nix ./oxinoti.nix ./oxishut.nix ./oxipaste.nix ];
|
||||
options.mods.oxi = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables oxi programs";
|
||||
};
|
||||
ReSet = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables and configures ReSet";
|
||||
};
|
||||
};
|
||||
hyprdock = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables hyprdock";
|
||||
};
|
||||
};
|
||||
oxicalc = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables hyprdock";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.mods.oxi.enable
|
||||
(lib.optionalAttrs (options ? home.packages) {
|
||||
programs = {
|
||||
hyprdock.enable = lib.mkIf config.mods.oxi.hyprdock.enable true;
|
||||
oxicalc.enable = lib.mkIf config.mods.oxi.oxicalc.enable true;
|
||||
ReSet = lib.mkIf config.mods.oxi.ReSet.enable {
|
||||
enable = true;
|
||||
config = {
|
||||
plugins = [
|
||||
inputs.reset-plugins.packages."x86_64-linux".monitor
|
||||
inputs.reset-plugins.packages."x86_64-linux".keyboard
|
||||
];
|
||||
plugin_config = {
|
||||
Keyboard = {
|
||||
path =
|
||||
"/home/${config.conf.username}/.config/reset/keyboard.conf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
64
modules/programs/oxi/oxidash.nix
Normal file
64
modules/programs/oxi/oxidash.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ lib, config, options, ... }: {
|
||||
options.mods.oxi.oxidash = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables and configures oxidash";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (config.mods.oxi.oxidash.enable && config.mods.oxi.enable)
|
||||
(lib.optionalAttrs (options ? xdg.configFile) {
|
||||
programs.oxidash.enable = true;
|
||||
xdg.configFile."oxidash/style.css" = {
|
||||
text = ''
|
||||
#MainWindow {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#MainBox {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#MainButtonBox {
|
||||
padding: 10px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
border-radius: 5px;
|
||||
border: solid 2px #327cd5;
|
||||
}
|
||||
|
||||
#DoNotDisturbButton {
|
||||
}
|
||||
|
||||
#ExitButton {
|
||||
}
|
||||
|
||||
#ClearNotificationsButton {
|
||||
}
|
||||
|
||||
#NotificationsWindow {
|
||||
}
|
||||
|
||||
.debugimage {
|
||||
border: solid 3px blue;
|
||||
}
|
||||
|
||||
.Notification {
|
||||
padding: 10px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
border: solid 2px #327cd5;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.CloseNotificationButton {
|
||||
margin: 0px 5px 0px 10px;
|
||||
}
|
||||
.PictureButtonBox {
|
||||
}
|
||||
.BaseBox {
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
104
modules/programs/oxi/oxinoti.nix
Normal file
104
modules/programs/oxi/oxinoti.nix
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
{ lib, config, options, ... }: {
|
||||
options.mods.oxi.oxinoti = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables and configures oxinoti";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (config.mods.oxi.oxinoti.enable && config.mods.oxi.enable)
|
||||
(lib.optionalAttrs (options ? xdg.configFile) {
|
||||
programs.oxinoti.enable = true;
|
||||
xdg.configFile."oxinoti/style.css" = {
|
||||
text = # css
|
||||
''
|
||||
@import url("/home/${config.conf.username}/.config/gtk-3.0/gtk.css");
|
||||
|
||||
#MainWindow {
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
|
||||
.MainBox {
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
|
||||
.NotificationBox {
|
||||
background-color: #353747;
|
||||
border-radius: 5px;
|
||||
border: solid 1px;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.NotificationLow {
|
||||
border-color: green;
|
||||
}
|
||||
|
||||
.NotificationNormal {
|
||||
border-color: purple;
|
||||
}
|
||||
|
||||
.NotificationUrgent {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.miscbox {
|
||||
margin: 0px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.bodybox {
|
||||
}
|
||||
|
||||
.imagebox {
|
||||
margin: 0px 0px 0px 10px;
|
||||
}
|
||||
|
||||
.appname {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.timestamp {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.summary {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.body {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.image {
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
'';
|
||||
};
|
||||
xdg.configFile."oxinoti/oxinoti.toml" = {
|
||||
text = ''
|
||||
timeout = 3
|
||||
dnd_override = 2
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
42
modules/programs/oxi/oxipaste.nix
Normal file
42
modules/programs/oxi/oxipaste.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, config, options, ... }: {
|
||||
options.mods.oxi.oxipaste = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables and configures oxipaste";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (config.mods.oxi.oxipaste.enable && config.mods.oxi.enable)
|
||||
(lib.optionalAttrs (options ? xdg.configFile) {
|
||||
programs.oxipaste.enable = true;
|
||||
xdg.configFile."oxipaste/style.css" = {
|
||||
text = ''
|
||||
.main-window {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border: 2px solid #2AC3DE;
|
||||
}
|
||||
|
||||
.item-window {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border: 2px solid #C0CAF5;
|
||||
}
|
||||
|
||||
.item-button {
|
||||
background-color: #1A1B26;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #6D728D;
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
margin: 5px 25px 5px 5px;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
}
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
36
modules/programs/oxi/oxishut.nix
Normal file
36
modules/programs/oxi/oxishut.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, config, options, ... }: {
|
||||
options.mods.oxi.oxishut = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables and configures oxishut";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (config.mods.oxi.oxishut.enable && config.mods.oxi.enable)
|
||||
(lib.optionalAttrs (options ? xdg.configFile) {
|
||||
programs.oxishut.enable = true;
|
||||
xdg.configFile."oxishut/style.css" = {
|
||||
text = ''
|
||||
#mainwindow {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.mainbox {
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin: 5px;
|
||||
background-color: #2b2c3b;
|
||||
-gtk-icon-size: 5rem;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: #3e4152;
|
||||
}
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
120
modules/programs/scripts.nix
Normal file
120
modules/programs/scripts.nix
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
{ lib, config, options, pkgs, ... }: {
|
||||
options.mods.scripts = {
|
||||
change-brightness = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables the change-brightness script";
|
||||
};
|
||||
audio-control = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables the audio-control script";
|
||||
};
|
||||
scripts = lib.mkOption {
|
||||
default = [ ];
|
||||
example = [ ];
|
||||
description =
|
||||
"More scripts to be passed. (check existing ones for types and examples)";
|
||||
};
|
||||
};
|
||||
config = (lib.optionalAttrs (options ? home.packages) {
|
||||
home.packages = [
|
||||
(lib.mkIf config.mods.scripts.change-brightness
|
||||
(pkgs.writeShellScriptBin "change-brightness" ''
|
||||
set_brightness() {
|
||||
brightnessctl set "$1"
|
||||
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
|
||||
dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: $\{CURRENT\}%"
|
||||
}
|
||||
|
||||
if [ "$1" == "brightness" ]; then
|
||||
set_brightness "$2"
|
||||
fi
|
||||
''))
|
||||
(lib.mkIf config.mods.scripts.audio-control
|
||||
(pkgs.writeShellScriptBin "audio-control" ''
|
||||
ncspot() {
|
||||
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
|
||||
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
|
||||
pactl set-sink-input-volume "$CHANGE" "$1"
|
||||
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
|
||||
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: $\{VOLUME\}%"
|
||||
}
|
||||
|
||||
firefox() {
|
||||
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
|
||||
# NUMS=',' read -r -a array <<< "$STRING"
|
||||
readarray -td, NUMS <<<"$STRING"
|
||||
declare -p NUMS
|
||||
for index in "$\{!NUMS[@]\}"; do #"$\{!array[@]\}"
|
||||
NUM=$(echo "$\{NUMS[index]\}" | tr -d ' \t\n')
|
||||
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
|
||||
pactl set-sink-input-volume "$CHANGE" "$1"
|
||||
done
|
||||
VOLUME=$(pactl list sink-inputs | rg "$\{NUMS[0]\}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
|
||||
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: $\{VOLUME\}%"
|
||||
}
|
||||
|
||||
internal() {
|
||||
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
|
||||
if [ "$SPEAKER" != "" ]; then
|
||||
pactl set-default-sink "$SPEAKER"
|
||||
pactl set-sink-mute "$SPEAKER" false
|
||||
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
|
||||
notify-send "changed audio to "$DEVICE" "
|
||||
else
|
||||
notify-send "failed, not available!"
|
||||
fi
|
||||
}
|
||||
|
||||
set_volume_sink() {
|
||||
pactl set-sink-volume @DEFAULT_SINK@ "$1"
|
||||
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
|
||||
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: $\{CURRENT\}%"
|
||||
}
|
||||
|
||||
set_volume_source() {
|
||||
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
|
||||
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
|
||||
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: $\{CURRENT\}%"
|
||||
}
|
||||
|
||||
bluetooth() {
|
||||
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
|
||||
if [ "$SPEAKER" != "" ]; then
|
||||
pactl set-default-sink "$SPEAKER"
|
||||
pactl set-sink-mute "$SPEAKER" false
|
||||
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
|
||||
notify-send "changed audio to "$DEVICE" "
|
||||
else
|
||||
notify-send "failed, not available!"
|
||||
fi
|
||||
}
|
||||
|
||||
mute() {
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
|
||||
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
|
||||
}
|
||||
|
||||
if [ "$1" == "internal" ]; then
|
||||
internal
|
||||
elif [ "$1" == "bluetooth" ]; then
|
||||
bluetooth
|
||||
elif [ "$1" == "firefox" ]; then
|
||||
firefox "$2"
|
||||
elif [ "$1" == "ncspot" ]; then
|
||||
ncspot "$2"
|
||||
elif [ "$1" == "mute" ]; then
|
||||
mute
|
||||
elif [ "$1" == "sink" ]; then
|
||||
set_volume_sink "$2"
|
||||
elif [ "$1" == "source" ]; then
|
||||
set_volume_source "$2"
|
||||
fi
|
||||
''))
|
||||
] ++ config.mods.scripts.scripts;
|
||||
});
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
{ imports = [ ./oxipaste.nix ./oxinoti.nix ./oxishut.nix ./oxidash.nix ]; }
|
||||
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
{
|
||||
xdg.configFile."oxidash/style.css" = {
|
||||
text = ''
|
||||
#MainWindow {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#MainBox {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#MainButtonBox {
|
||||
padding: 10px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
border-radius: 5px;
|
||||
border: solid 2px #327cd5;
|
||||
}
|
||||
|
||||
#DoNotDisturbButton {
|
||||
}
|
||||
|
||||
#ExitButton {
|
||||
}
|
||||
|
||||
#ClearNotificationsButton {
|
||||
}
|
||||
|
||||
#NotificationsWindow {
|
||||
}
|
||||
|
||||
.debugimage {
|
||||
border: solid 3px blue;
|
||||
}
|
||||
|
||||
.Notification {
|
||||
padding: 10px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
border: solid 2px #327cd5;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.CloseNotificationButton {
|
||||
margin: 0px 5px 0px 10px;
|
||||
}
|
||||
.PictureButtonBox {
|
||||
}
|
||||
.BaseBox {
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
{ config, ... }: {
|
||||
xdg.configFile."oxinoti/style.css" = {
|
||||
text = # css
|
||||
''
|
||||
@import url("/home/${config.conf.username}/.config/gtk-3.0/gtk.css");
|
||||
|
||||
#MainWindow {
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
|
||||
.MainBox {
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
/* opacity: 0; */
|
||||
}
|
||||
|
||||
.NotificationBox {
|
||||
background-color: #353747;
|
||||
border-radius: 5px;
|
||||
border: solid 1px;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.NotificationLow {
|
||||
border-color: green;
|
||||
}
|
||||
|
||||
.NotificationNormal {
|
||||
border-color: purple;
|
||||
}
|
||||
|
||||
.NotificationUrgent {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.miscbox {
|
||||
margin: 0px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.bodybox {
|
||||
}
|
||||
|
||||
.imagebox {
|
||||
margin: 0px 0px 0px 10px;
|
||||
}
|
||||
|
||||
.appname {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.timestamp {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.summary {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.body {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.image {
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
'';
|
||||
};
|
||||
xdg.configFile."oxinoti/oxinoti.toml" = {
|
||||
text = ''
|
||||
timeout = 3
|
||||
dnd_override = 2
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
xdg.configFile."oxipaste/style.css" = {
|
||||
text = ''
|
||||
.main-window {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border: 2px solid #2AC3DE;
|
||||
}
|
||||
|
||||
.item-window {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border: 2px solid #C0CAF5;
|
||||
}
|
||||
|
||||
.item-button {
|
||||
background-color: #1A1B26;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #6D728D;
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
margin: 5px 25px 5px 5px;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
xdg.configFile."oxishut/style.css" = {
|
||||
text = ''
|
||||
#mainwindow {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.mainbox {
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin: 5px;
|
||||
background-color: #2b2c3b;
|
||||
-gtk-icon-size: 5rem;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: #3e4152;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
|
||||
ncspot() {
|
||||
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
|
||||
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
|
||||
pactl set-sink-input-volume "$CHANGE" "$1"
|
||||
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
|
||||
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ${VOLUME}%"
|
||||
}
|
||||
|
||||
firefox() {
|
||||
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
|
||||
# NUMS=',' read -r -a array <<< "$STRING"
|
||||
readarray -td, NUMS <<<"$STRING"
|
||||
declare -p NUMS
|
||||
for index in "${!NUMS[@]}"; do #"${!array[@]}"
|
||||
NUM=$(echo "${NUMS[index]}" | tr -d ' \t\n')
|
||||
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
|
||||
pactl set-sink-input-volume "$CHANGE" "$1"
|
||||
done
|
||||
VOLUME=$(pactl list sink-inputs | rg "${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
|
||||
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ${VOLUME}%"
|
||||
}
|
||||
|
||||
internal() {
|
||||
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
|
||||
if [ "$SPEAKER" != "" ]; then
|
||||
pactl set-default-sink "$SPEAKER"
|
||||
pactl set-sink-mute "$SPEAKER" false
|
||||
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
|
||||
notify-send "changed audio to "$DEVICE" "
|
||||
else
|
||||
notify-send "failed, not available!"
|
||||
fi
|
||||
}
|
||||
|
||||
set_volume_sink() {
|
||||
pactl set-sink-volume @DEFAULT_SINK@ "$1"
|
||||
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
|
||||
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ${CURRENT}%"
|
||||
}
|
||||
|
||||
set_volume_source() {
|
||||
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
|
||||
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
|
||||
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ${CURRENT}%"
|
||||
}
|
||||
|
||||
bluetooth() {
|
||||
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
|
||||
if [ "$SPEAKER" != "" ]; then
|
||||
pactl set-default-sink "$SPEAKER"
|
||||
pactl set-sink-mute "$SPEAKER" false
|
||||
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
|
||||
notify-send "changed audio to "$DEVICE" "
|
||||
else
|
||||
notify-send "failed, not available!"
|
||||
fi
|
||||
}
|
||||
|
||||
mute() {
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
|
||||
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
|
||||
}
|
||||
|
||||
if [ "$1" == "internal" ]; then
|
||||
internal
|
||||
elif [ "$1" == "bluetooth" ]; then
|
||||
bluetooth
|
||||
elif [ "$1" == "firefox" ]; then
|
||||
firefox "$2"
|
||||
elif [ "$1" == "ncspot" ]; then
|
||||
ncspot "$2"
|
||||
elif [ "$1" == "mute" ]; then
|
||||
mute
|
||||
elif [ "$1" == "sink" ]; then
|
||||
set_volume_sink "$2"
|
||||
elif [ "$1" == "source" ]; then
|
||||
set_volume_source "$2"
|
||||
fi
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#! /bin/bash
|
||||
|
||||
set_brightness() {
|
||||
brightnessctl set "$1"
|
||||
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
|
||||
dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ${CURRENT}%"
|
||||
}
|
||||
|
||||
if [ "$1" == "brightness" ]; then
|
||||
set_brightness "$2"
|
||||
fi
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
read -p "formatting disk $1 with hostname $2 is this correct? " IN
|
||||
read -p "is the disk an nvme drive? " NVME
|
||||
if [ "$IN" == "y" ]; then
|
||||
echo "commencing"
|
||||
#format disk
|
||||
parted $1 mklabel gpt mkpart primary fat32 1MiB 512MiB mkpart primary linux-swap 512MiB 31029MiB mkpart primary btrfs 31029MiB 40% mkpart primary btrfs 40% 100%
|
||||
if [ "$NVME" == "y" ]; then
|
||||
e2label $1p1 BOOT
|
||||
e2label $1p2 SWAP
|
||||
e2label $1p3 ROOT
|
||||
e2label $1p4 HOME
|
||||
else
|
||||
e2label "$1"1 BOOT
|
||||
e2label "$1"2 SWAP
|
||||
e2label "$1"3 ROOT
|
||||
e2label "$1"4 HOME
|
||||
fi
|
||||
# install nixos
|
||||
echo "formatting finished, continuing to install system"
|
||||
nixos-install --flake ./nix/.#$2 --no-root-passwd
|
||||
else
|
||||
echo "aborting"
|
||||
fi
|
||||
|
|
@ -1 +0,0 @@
|
|||
echo "Do you have time to talk about the lord and savior PenguinOS?" | wl-copy
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
echo "Are you tired about ads on your operating system? About forced telemetry? About arbitrary installation requirements like online accounts or forced hardware upgrades?
|
||||
Fear not penguin is for you, free of charge and free to change. Penguin does not control you, you control penguin.
|
||||
Don't delay, install penguin today: https://distrochooser.de/" | wl-copy
|
||||
Loading…
Add table
Add a link
Reference in a new issue