properly reformat all files

This commit is contained in:
Franek 2025-05-03 09:25:00 +02:00
parent 635ef052e7
commit 5948c1db1c
18 changed files with 324 additions and 287 deletions

View File

@ -10,16 +10,22 @@
ags.url = "github:Aylur/ags";
fingerprint-sensor.url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor/24.11";
android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
hyprspace.url = "github:KZDKM/Hyprspace";
android-nixpkgs.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.inputs.nixpkgs.follows = "nixpkgs";
ags.inputs.nixpkgs.follows = "nixpkgs";
android-nixpkgs.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.inputs.nixpkgs.follows = "nixpkgs";
ags.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, android-nixpkgs, ... }:
outputs =
{
self,
nixpkgs,
android-nixpkgs,
...
}:
let
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
@ -29,12 +35,16 @@
in
{
nixosConfigurations = import ./hosts { inherit self; };
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
ddt4all = import ./shells/ddt4all.nix { inherit pkgs; };
android = import ./shells/android.nix { inherit pkgs android-nixpkgs; };
rust = import ./shells/rust.nix { inherit pkgs; };
});
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
ddt4all = import ./shells/ddt4all.nix { inherit pkgs; };
android = import ./shells/android.nix { inherit pkgs android-nixpkgs; };
rust = import ./shells/rust.nix { inherit pkgs; };
}
);
};
}

View File

@ -3,7 +3,7 @@
let
inherit (self) inputs;
lib = inputs.nixpkgs.lib;
lib = inputs.nixpkgs.lib;
homeDir = self + /profiles;
mkSystem =
@ -12,16 +12,17 @@ let
hostname,
useHomeManager ? true,
modules ? [ ],
}: lib.nixosSystem {
}:
lib.nixosSystem {
specialArgs = { inherit inputs; };
modules =
[
./base-configuration.nix
./${hostname}
homeDir
]
++ lib.lists.optionals useHomeManager [ inputs.home-manager.nixosModules.default ]
++ modules;
]
++ lib.lists.optionals useHomeManager [ inputs.home-manager.nixosModules.default ]
++ modules;
};
in
{

View File

@ -9,9 +9,12 @@
];
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
};
nix.gc = {
automatic = true;
@ -19,16 +22,16 @@
options = "--delete-older-than 7d";
};
nixpkgs.config = {
allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [
"nvidia-settings"
"nvidia-x11"
"nordvpn"
"hplip"
];
};
nixpkgs.config = {
allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [
"nvidia-settings"
"nvidia-x11"
"nordvpn"
"hplip"
];
};
swapDevices = [
{

View File

@ -9,12 +9,12 @@
../../modules/nixos/greetd.nix
../../modules/nixos/audio.nix
# Apps + services
../../modules/nixos/nordvpn.nix
# Apps + services
../../modules/nixos/nordvpn.nix
];
modules.bluetooth.enable = true;
modules.nordvpn.enable = true;
modules.nordvpn.enable = true;
modules.nvidia.enable = true;
modules.audio.enable = true;
modules.fingerprint-fix = {
@ -38,7 +38,7 @@
};
udev.extraRules = ''
SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
'';
};

View File

@ -28,19 +28,19 @@ let
dontBuild = true;
unpackPhase = ''
runHook preUnpack
dpkg --extract $src .
runHook postUnpack
'';
runHook preUnpack
dpkg --extract $src .
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out
mv usr/* $out/
mv var/ $out/
mv etc/ $out/
runHook postInstall
'';
runHook preInstall
mkdir -p $out
mv usr/* $out/
mv var/ $out/
mv etc/ $out/
runHook postInstall
'';
};
nordVPNfhs = pkgs.buildFHSEnvChroot {
@ -63,11 +63,11 @@ let
};
preScript = pkgs.writeShellScript "nordvpn-start" ''
mkdir -m 700 -p /var/lib/nordvpn;
if [ -z "$(ls -A /var/lib/nordvpn)" ]; then
cp -r ${nordVPNBase}/var/lib/nordvpn/* /var/lib/nordvpn;
fi
'';
mkdir -m 700 -p /var/lib/nordvpn;
if [ -z "$(ls -A /var/lib/nordvpn)" ]; then
cp -r ${nordVPNBase}/var/lib/nordvpn/* /var/lib/nordvpn;
fi
'';
in
pkgs.stdenv.mkDerivation rec {
inherit pname version;
@ -77,14 +77,14 @@ pkgs.stdenv.mkDerivation rec {
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share
ln -s ${nordVPNBase}/bin/nordvpn $out/bin
ln -s ${nordVPNfhs}/bin/nordvpnd $out/bin
ln -s ${nordVPNBase}/share/* $out/share/
ln -s ${nordVPNBase}/var $out/
runHook postInstall
'';
runHook preInstall
mkdir -p $out/bin $out/share
ln -s ${nordVPNBase}/bin/nordvpn $out/bin
ln -s ${nordVPNfhs}/bin/nordvpnd $out/bin
ln -s ${nordVPNBase}/share/* $out/share/
ln -s ${nordVPNBase}/var $out/
runHook postInstall
'';
meta = with lib; {
description = "CLI client for NordVPN";

View File

@ -1,5 +1,32 @@
{ config, pkgs, lib, inputs, ... }:
{
config,
pkgs,
lib,
inputs,
...
}:
let
generate-colors =
colors: with colors; ''
$base00: #${base00};
$base01: #${base01};
$base02: #${base02};
$base03: #${base03};
$base04: #${base04};
$base05: #${base05};
$base06: #${base06};
$base07: #${base07};
$base08: #${base08};
$base09: #${base09};
$base0A: #${base0A};
$base0B: #${base0B};
$base0C: #${base0C};
$base0D: #${base0D};
$base0E: #${base0E};
$base0F: #${base0F};
'';
in
{
options.modules.ags = {
enable = lib.mkEnableOption "Aylur's GTK Shell with optional Stylix support";
@ -11,43 +38,29 @@
};
config = lib.mkIf config.modules.ags.enable {
programs.ags = {
enable = true;
extraPackages = if config.modules.ags.full then
with inputs.ags.packages.${pkgs.system};
[
apps
battery
bluetooth
greet
hyprland
mpris
network
notifd
powerprofiles
tray
wireplumber
] else [];
};
programs.ags = {
enable = true;
extraPackages =
if config.modules.ags.full then
with inputs.ags.packages.${pkgs.system};
[
apps
battery
bluetooth
greet
hyprland
mpris
network
notifd
powerprofiles
tray
wireplumber
]
else
[ ];
};
home.file.".config/theme_colors.scss".text = if config.modules.stylix.enable
then with config.lib.stylix.colors; ''
$base00: #${base00};
$base01: #${base01};
$base02: #${base02};
$base03: #${base03};
$base04: #${base04};
$base05: #${base05};
$base06: #${base06};
$base07: #${base07};
$base08: #${base08};
$base09: #${base09};
$base0A: #${base0A};
$base0B: #${base0B};
$base0C: #${base0C};
$base0D: #${base0D};
$base0E: #${base0E};
$base0F: #${base0F};
'' else null;
home.file.".config/theme_colors.scss".text =
if config.modules.stylix.enable then generate-colors config.lib.stylix.colors else null;
};
}

View File

@ -1,35 +1,35 @@
{
config,
lib,
pkgs,
inputs,
...
config,
lib,
pkgs,
inputs,
...
}:
{
options.modules.apple-style.enable = lib.mkEnableOption "Enable Apple fonts and emojis";
config = lib.mkIf (config.modules.apple-style.enable && config.modules.stylix.enable) {
stylix.fonts = {
serif = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd;
name = "SFProDisplay Nerd Font";
};
stylix.fonts = {
serif = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd;
name = "SFProDisplay Nerd Font";
};
sansSerif = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd;
name = "SFProText Nerd Font";
};
sansSerif = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd;
name = "SFProText Nerd Font";
};
monospace = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-mono-nerd;
name = "SFMono Nerd Font";
};
monospace = {
package = inputs.apple-fonts.packages.${pkgs.system}.sf-mono-nerd;
name = "SFMono Nerd Font";
};
emoji = {
package = inputs.apple-emoji.packages.${pkgs.system}.apple-emoji-nix;
name = "Apple Color Emoji";
};
};
emoji = {
package = inputs.apple-emoji.packages.${pkgs.system}.apple-emoji-nix;
name = "Apple Color Emoji";
};
};
};
}

View File

@ -6,39 +6,40 @@
}:
let
inherit (pkgs.lib) optionalAttrs;
inherit (pkgs.lib) optionalAttrs;
home-manager = "${pkgs.home-manager}/bin/home-manager";
grep = lib.getExe' pkgs.toybox "grep";
head = lib.getExe' pkgs.toybox "head";
find = lib.getExe' pkgs.toybox "find";
find-generation = ''
for line in $(${home-manager} generations | ${grep} -o '/.*')
find-generation = ''
for line in $(${home-manager} generations | ${grep} -o '/.*')
do
res=$(${find} $line | ${grep} specialisation | ${head} -1)
res=$(${find} $line | ${grep} specialisation | ${head} -1)
output=$?
if [[ $output -eq 0 ]] && [[ $res != "" ]]; then
echo $res
echo $res
exit
fi
done
'';
switch-theme = theme: "$(${find-generation})/${theme}/activate";
in {
switch-theme = theme: "$(${find-generation})/${theme}/activate";
in
{
options.modules.darkman = {
enable = lib.mkEnableOption "Darkman service and integration";
customLightModeScript = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
default = null;
description = "Path to custom light mode script";
};
customDarkModeScript = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
default = null;
description = "Path to custom dark mode script";
};
};
@ -46,17 +47,21 @@ in {
config = lib.mkIf config.modules.darkman.enable {
services.darkman = {
enable = true;
darkModeScripts = optionalAttrs (config.modules.darkman.customDarkModeScript != null) {
custom = config.modules.darkman.customDarkModeScript;
} // optionalAttrs (config.modules.stylix.enable) {
stylix = switch-theme "dark";
};
darkModeScripts =
optionalAttrs (config.modules.darkman.customDarkModeScript != null) {
custom = config.modules.darkman.customDarkModeScript;
}
// optionalAttrs (config.modules.stylix.enable) {
stylix = switch-theme "dark";
};
lightModeScripts = optionalAttrs (config.modules.darkman.customLightModeScript != null) {
custom = config.modules.darkman.customLightModeScript;
} // optionalAttrs (config.modules.stylix.enable) {
stylix = switch-theme "light";
};
lightModeScripts =
optionalAttrs (config.modules.darkman.customLightModeScript != null) {
custom = config.modules.darkman.customLightModeScript;
}
// optionalAttrs (config.modules.stylix.enable) {
stylix = switch-theme "light";
};
settings.usegeoclue = true;
};

View File

@ -1,62 +1,62 @@
{
config,
lib,
pkgs,
inputs,
...
config,
lib,
pkgs,
inputs,
...
}:
{
options.modules.stylix = {
enable = lib.mkEnableOption "Whether to enable Stylix, a theme manager for NixOS";
setupCursors = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to setup cursors by default";
};
options.modules.stylix = {
enable = lib.mkEnableOption "Whether to enable Stylix, a theme manager for NixOS";
setupCursors = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to setup cursors by default";
};
lightWallpaper = lib.mkOption {
type = lib.types.path;
description = "Path to light theme desktop wallpaper";
};
lightWallpaper = lib.mkOption {
type = lib.types.path;
description = "Path to light theme desktop wallpaper";
};
darkWallpaper = lib.mkOption {
type = lib.types.path;
description = "Path to dark theme desktop wallpaper";
};
};
darkWallpaper = lib.mkOption {
type = lib.types.path;
description = "Path to dark theme desktop wallpaper";
};
};
imports = [
inputs.stylix.homeManagerModules.stylix
];
imports = [
inputs.stylix.homeManagerModules.stylix
];
config = lib.mkIf config.modules.stylix.enable {
stylix = {
enable = true;
polarity = lib.mkDefault "light";
config = lib.mkIf config.modules.stylix.enable {
stylix = {
enable = true;
polarity = lib.mkDefault "light";
image = lib.mkDefault config.modules.stylix.lightWallpaper;
base16Scheme = lib.mkDefault "${pkgs.base16-schemes}/share/themes/atelier-cave.yaml";
image = lib.mkDefault config.modules.stylix.lightWallpaper;
base16Scheme = lib.mkDefault "${pkgs.base16-schemes}/share/themes/atelier-cave.yaml";
cursor = lib.mkIf config.modules.stylix.setupCursors {
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = 24;
};
};
cursor = lib.mkIf config.modules.stylix.setupCursors {
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = 24;
};
};
specialisation = {
light.configuration.stylix = {
polarity = "light";
image = config.modules.stylix.lightWallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-cave-light.yaml";
};
specialisation = {
light.configuration.stylix = {
polarity = "light";
image = config.modules.stylix.lightWallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-cave-light.yaml";
};
dark.configuration.stylix = {
polarity = "dark";
image = config.modules.stylix.darkWallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-cave.yaml";
};
};
};
dark.configuration.stylix = {
polarity = "dark";
image = config.modules.stylix.darkWallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-cave.yaml";
};
};
};
}

View File

@ -7,8 +7,9 @@
}:
let
module = inputs.fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor";
in {
module = inputs.fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor";
in
{
options.modules.fingerprint-fix = {
enable = lib.mkEnableOption "Enable support for fingerprint for P51S-like ThinkPads.";
calibDataFile = lib.mkOption {
@ -41,7 +42,7 @@ in {
calib-data-file = config.modules.fingerprint-fix.calibDataFile;
};
security.pam.services.su.fprintAuth = true;
security.pam.services.su.fprintAuth = true;
security.pam.services.sudo.fprintAuth = true;
security.pam.services.login.fprintAuth = true;
security.pam.services.greetd.fprintAuth = true;

View File

@ -4,21 +4,21 @@
options.modules.nvidia.enable = lib.mkEnableOption "Enable NVIDIA kernel and modprobe configurations.";
config = lib.mkIf config.modules.nvidia.enable {
hardware.graphics = {
enable = true;
};
hardware.graphics = {
enable = true;
};
services.xserver.videoDrivers = ["nvidia"];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}

View File

@ -11,25 +11,25 @@ in
inherit username homeDirectory;
packages = import ./packages.nix { inherit pkgs inputs; };
sessionVariables = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
TZ = "Europe/Warsaw";
};
};
nixpkgs.config = {
permittedInsecurePackages = [
"fluffychat-linux-1.26.0"
nixpkgs.config = {
permittedInsecurePackages = [
"fluffychat-linux-1.26.0"
"olm-3.2.16"
];
allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [
"davinci-resolve"
"anydesk"
];
};
allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [
"davinci-resolve"
"anydesk"
];
};
programs.home-manager.enable = true;
home.stateVersion = "24.11";

View File

@ -1,7 +1,7 @@
{
webcopy = ''
set -l domain (string trim $argv)
get --recursive \
wget --recursive \
--level 5 \
--no-clobber \
--page-requisites \
@ -15,18 +15,18 @@
venv = ''
if [ -d .venv ]; then
source .venv/bin/activate.fish
else
python -m venv .venv
source .venv/bin/activate.fish
fi
source .venv/bin/activate.fish
else
python -m venv .venv
source .venv/bin/activate.fish
fi
'';
thunderbird = ''
if pgrep -x birdtray > /dev/null
birdtray -s
else
birdtray &
end
birdtray -s
else
birdtray &
end
'';
}

View File

@ -4,13 +4,13 @@
imports = [
# DE + style
../../modules/desktop-environments/hyprland.nix
../../modules/home-manager/apple-style.nix
../../modules/home-manager/stylix.nix
../../modules/home-manager/apple-style.nix
../../modules/home-manager/stylix.nix
# Utilities + apps
../../modules/home-manager/darkman.nix
../../modules/home-manager/fish.nix
../../modules/home-manager/ags.nix
../../modules/home-manager/ags.nix
# Home Manager modules
inputs.ags.homeManagerModules.default
@ -41,21 +41,21 @@
};
};
modules.stylix = {
enable = true;
lightWallpaper = ./wallpapers/light.jpg;
darkWallpaper = ./wallpapers/dark.jpg;
};
modules.stylix = {
enable = true;
lightWallpaper = ./wallpapers/light.jpg;
darkWallpaper = ./wallpapers/dark.jpg;
};
stylix.targets.firefox.profileNames = ["default"];
stylix.targets.firefox.profileNames = [ "default" ];
modules.ags = {
enable = true;
full = true;
};
modules.ags = {
enable = true;
full = true;
};
modules.darkman.enable = true;
modules.apple-style.enable = true;
modules.apple-style.enable = true;
modules.fish = {
enable = true;
@ -76,12 +76,12 @@
];
};
programs.vscode = {
enable = true;
package = pkgs.vscodium;
profiles.default.extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
bbenoist.nix
];
};
programs.vscode = {
enable = true;
package = pkgs.vscodium;
profiles.default.extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
bbenoist.nix
];
};
}

View File

@ -1,21 +1,22 @@
{ pkgs, inputs, ... }:
with pkgs; [
with pkgs;
[
(python3.withPackages (
py: with py; [
pywayland
]
py: with py; [
pywayland
]
))
(birdtray.overrideAttrs (_: {
cmakeFlags = [ "-DOPT_THUNDERBIRD_CMDLINE=${thunderbird}/bin/thunderbird" ];
cmakeFlags = [ "-DOPT_THUNDERBIRD_CMDLINE=${thunderbird}/bin/thunderbird" ];
}))
jq
starship
firefox
fluffychat
home-manager
jq
starship
firefox
fluffychat
home-manager
thunderbird-bin
youtube-music
libreoffice-qt6-fresh
@ -31,5 +32,5 @@ with pkgs; [
bitwarden-desktop
davinci-resolve
mpv
sshfs
sshfs
]

View File

@ -1,22 +1,25 @@
{ pkgs, android-nixpkgs }:
let
android = pkgs.callPackage android-nixpkgs {};
androidSdk = android.sdk (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-35-0-0
platform-tools
platforms-android-35
]);
android = pkgs.callPackage android-nixpkgs { };
androidSdk = android.sdk (
sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-35-0-0
platform-tools
platforms-android-35
]
);
in pkgs.mkShell rec {
in
pkgs.mkShell rec {
buildInputs = with pkgs; [
androidSdk
jdk17
glibc
];
androidSdk
jdk17
glibc
];
ANDROID_JAVA_HOME = "${pkgs.jdk17.home}";
ANDROID_JAVA_HOME = "${pkgs.jdk17.home}";
ANDROID_SDK_ROOT = "${androidSdk}/share/android-sdk";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/35.0.0/aapt2";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/35.0.0/aapt2";
}

View File

@ -45,7 +45,7 @@ pkgs.mkShell {
nativeBuildInputs = [ pkgs.libsForQt5.qt5.wrapQtAppsHook ];
shellHook = ''
wrapQtAppsHook
wrapQtAppsHook
mkdir -p $HOME/DDT4ALL
cp -r $src/bin/* $HOME/DDT4ALL

View File

@ -3,15 +3,15 @@
pkgs.mkShell {
buildInputs = with pkgs; [
rustc
cargo
cargo
rustfmt
rust-analyzer
clippy
gcc
libpqxx
postgresql
gcc
libpqxx
postgresql
];
RUST_BACKTRACE = 1;
RUSTC_BOOTSTRAP = true;
RUST_BACKTRACE = 1;
RUSTC_BOOTSTRAP = true;
}