Compare commits
No commits in common. "675d77f1ce553c04f209fcb0fb352d2246c32af2" and "ed2aaf9f1522a0462967302d6b1d35f78db60dac" have entirely different histories.
675d77f1ce
...
ed2aaf9f15
17 changed files with 178 additions and 74 deletions
|
@ -3,12 +3,9 @@ extend-exclude = [
|
|||
"secrets.yaml",
|
||||
|
||||
# hex color
|
||||
"home/applications/hyprland/hypr/themes",
|
||||
"home/applications/swaylock/default.nix",
|
||||
]
|
||||
|
||||
[default.extend-words]
|
||||
# osu
|
||||
lazer = "lazer"
|
||||
|
||||
# https://en.wikipedia.org/wiki/IATA_airport_code
|
||||
tyo = "tyo"
|
||||
lazer = "lazer" # osu
|
||||
|
|
42
flake.lock
42
flake.lock
|
@ -2,9 +2,7 @@
|
|||
"nodes": {
|
||||
"aagl": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"flake-compat"
|
||||
],
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -87,6 +85,22 @@
|
|||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
|
@ -323,9 +337,7 @@
|
|||
"nixpkgs-docs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-for-bootstrap": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
|
||||
"nmd": [
|
||||
"nmd"
|
||||
]
|
||||
|
@ -411,6 +423,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-for-bootstrap": {
|
||||
"locked": {
|
||||
"lastModified": 1708105575,
|
||||
"narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1718229064,
|
||||
|
@ -542,7 +570,7 @@
|
|||
"berberman": "berberman",
|
||||
"crane": "crane",
|
||||
"disko": "disko",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-utils": "flake-utils",
|
||||
"gitignore": "gitignore",
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
aagl = {
|
||||
url = "github:ezKEa/aagl-gtk-on-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-compat.follows = "flake-compat";
|
||||
};
|
||||
berberman = {
|
||||
url = "github:berberman/flakes";
|
||||
|
@ -65,7 +64,6 @@
|
|||
nix-on-droid = {
|
||||
url = "github:nix-community/nix-on-droid/release-23.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs-for-bootstrap.follows = "nixpkgs";
|
||||
inputs.nixpkgs-docs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
inputs.nix-formatter-pack.follows = "nix-formatter-pack";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
hardware.nvidia.nvidiaSettings = false;
|
||||
services.hdapsd.enable = false;
|
||||
my.hardware = {
|
||||
myFlake.hardware.components = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
tpm.enable = true;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
inputs.nixos-sensible.nixosModules.zram
|
||||
];
|
||||
|
||||
my.hardware = {
|
||||
myFlake.hardware.components = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
tpm.enable = true;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
# utils that is used internally
|
||||
./my/boot.nix
|
||||
./my/hardware/audio.nix
|
||||
./my/hardware/bluetooth.nix
|
||||
./my/hardware/tpm.nix
|
||||
./myFlake/boot.nix
|
||||
./myFlake/hardware/accessories/logitech-wireless.nix
|
||||
./myFlake/hardware/accessories/piper.nix
|
||||
./myFlake/hardware/accessories/xbox-one-controller.nix
|
||||
./myFlake/hardware/components/audio.nix
|
||||
./myFlake/hardware/components/bluetooth.nix
|
||||
./myFlake/hardware/components/tpm.nix
|
||||
|
||||
# nixpkgs styled options
|
||||
./services/hysteria.nix
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.my.hardware.audio;
|
||||
in {
|
||||
options = {
|
||||
my.hardware.audio.enable = lib.mkEnableOption "audio";
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/PipeWire
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.my.hardware.tpm;
|
||||
in {
|
||||
options = {
|
||||
my.hardware.tpm.enable = lib.mkEnableOption "TPM";
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/TPM
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.tpm2 = {
|
||||
enable = true;
|
||||
pkcs11.enable = true;
|
||||
tctiEnvironment.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -3,12 +3,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.my.boot;
|
||||
cfg = config.myFlake.boot;
|
||||
in {
|
||||
options = {
|
||||
my.boot = {
|
||||
silentBoot = lib.mkEnableOption "silent boot";
|
||||
noLoaderMenu = lib.mkEnableOption "" // {description = "Whether to disable bootloader menu.";};
|
||||
myFlake = {
|
||||
boot = {
|
||||
silentBoot = lib.mkEnableOption "Whether to enable silent boot.";
|
||||
noLoaderMenu = lib.mkEnableOption "Whether to disable bootloader menu.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.hardware.accessories.logitech-wireless;
|
||||
in {
|
||||
options = {
|
||||
myFlake.hardware.accessories.logitech-wireless.enable =
|
||||
lib.mkEnableOption "Whether to enable support for wireless Logitech hardwares.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.logitech.wireless = {
|
||||
enable = true;
|
||||
enableGraphical = true;
|
||||
};
|
||||
};
|
||||
}
|
18
nixos/modules/myFlake/hardware/accessories/piper.nix
Normal file
18
nixos/modules/myFlake/hardware/accessories/piper.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.hardware.accessories.piper;
|
||||
in {
|
||||
options = {
|
||||
myFlake.hardware.accessories.piper.enable =
|
||||
lib.mkEnableOption "Whether to enable Piper.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.piper];
|
||||
services.ratbagd.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.hardware.accessories.xboxOneController;
|
||||
in {
|
||||
options = {
|
||||
myFlake.hardware.accessories.xboxOneController.enable =
|
||||
lib.mkEnableOption "Whether to enable support for Xbox One controllers.";
|
||||
};
|
||||
|
||||
# https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.xone.enable = true; # via wired or wireless dongle
|
||||
hardware.xpadneo.enable = true; # via Bluetooth
|
||||
};
|
||||
}
|
37
nixos/modules/myFlake/hardware/components/audio.nix
Normal file
37
nixos/modules/myFlake/hardware/components/audio.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.hardware.components.audio;
|
||||
in {
|
||||
options = {
|
||||
myFlake.hardware.components.audio.enable = lib.mkEnableOption "Whether to enable audio.";
|
||||
myFlake.hardware.components.audio.soundServer = lib.mkOption {
|
||||
type = lib.types.enum ["pipewire" "pulseaudio"];
|
||||
default = "pipewire";
|
||||
example = "pulseaudio";
|
||||
description = "Select desired sound system.";
|
||||
};
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/PipeWire
|
||||
# https://nixos.wiki/wiki/PulseAudio
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
(lib.mkIf (cfg.soundServer == "pipewire") {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
})
|
||||
(lib.mkIf (cfg.soundServer == "pulseaudio") {
|
||||
hardware.pulseaudio.enable = true;
|
||||
hardware.pulseaudio.support32Bit = true;
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -4,15 +4,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.my.hardware.bluetooth;
|
||||
cfg = config.myFlake.hardware.components.bluetooth;
|
||||
in {
|
||||
options = {
|
||||
my.hardware.bluetooth.enable = lib.mkEnableOption "bluetooth";
|
||||
myFlake.hardware.components.bluetooth.enable = lib.mkEnableOption "Whether to enable bluetooth.";
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/Bluetooth
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Bluetooth manager
|
||||
#services.blueman.enable = true;
|
||||
environment.systemPackages = lib.mkIf config.services.xserver.enable (with pkgs; [blueberry]);
|
||||
|
||||
# Bluetooth service
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings.General.FastConnectable = true;
|
25
nixos/modules/myFlake/hardware/components/tpm.nix
Normal file
25
nixos/modules/myFlake/hardware/components/tpm.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.hardware.components.tpm;
|
||||
in {
|
||||
options = {
|
||||
myFlake.hardware.components.tpm.enable = lib.mkEnableOption "Whether to enable TPM.";
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/TPM
|
||||
config = lib.mkIf cfg.enable {
|
||||
# TPM is currently broken on latest kernel,
|
||||
# but luckily, linux-zen have a patch for it
|
||||
# UPDATE: it got fixed in 6.5.3
|
||||
#
|
||||
# python3.11-tpm2-pytss-2.1.0 failed with exit code 1 after ⏱ 34s
|
||||
security.tpm2 = {
|
||||
enable = true;
|
||||
#pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so
|
||||
tctiEnvironment.enable = true; # tpm2tools_tcti and tpm2_pkcs11_tcti env variables
|
||||
};
|
||||
};
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
};
|
||||
|
||||
### Options
|
||||
my.boot.noLoaderMenu = lib.mkDefault true;
|
||||
myFlake.boot.noLoaderMenu = lib.mkDefault true;
|
||||
|
||||
fonts.enableDefaultPackages = false;
|
||||
security.pam.services.swaylock = {};
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
# https://github.com/NixOS/nixpkgs/issues/47932
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
# https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth
|
||||
hardware.xone.enable = true; # via wired or wireless dongle
|
||||
hardware.xpadneo.enable = true; # via Bluetooth
|
||||
myFlake.hardware.accessories.xboxOneController.enable = lib.mkDefault true;
|
||||
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
|
@ -25,6 +23,7 @@
|
|||
|
||||
# Integrate with NVIDIA Optimus offloading.
|
||||
# https://github.com/FeralInteractive/gamemode#note-for-hybrid-gpu-users
|
||||
# https://github.com/NixOS/nixpkgs/pull/273177
|
||||
environment.sessionVariables = {
|
||||
"GAMEMODERUNEXEC" = let
|
||||
inherit (config.hardware.nvidia.prime) offload;
|
||||
|
|
Loading…
Reference in a new issue