mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-22 10:41:35 +02:00
modules: Format with nixfmt-rfc-style
This commit is contained in:
parent
1d0296c209
commit
a32f73a388
@ -1,4 +1,9 @@
|
|||||||
{ config, nix-config, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nix-config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
@ -46,16 +51,16 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [ "d /run/user/1000 0700 ${username} users -" ];
|
||||||
"d /run/user/1000 0700 ${username} users -"
|
|
||||||
];
|
|
||||||
|
|
||||||
containers = mkIf enableContainers {
|
containers = mkIf enableContainers {
|
||||||
wine = template // {
|
wine = template // {
|
||||||
hostAddress = "192.168.100.34";
|
hostAddress = "192.168.100.34";
|
||||||
localAddress = "192.168.100.49";
|
localAddress = "192.168.100.49";
|
||||||
|
|
||||||
config = { ... }: {
|
config =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../containers
|
../containers
|
||||||
../containers/wine.nix
|
../containers/wine.nix
|
||||||
|
@ -1,24 +1,52 @@
|
|||||||
{ nix-config, pkgs, config, lib, ... }:
|
{
|
||||||
|
nix-config,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
|
||||||
inherit (lib.types) float int;
|
inherit (lib.types) float int;
|
||||||
inherit (config.modules.system) username;
|
inherit (config.modules.system) username;
|
||||||
inherit (config.lib.stylix.colors.withHashtag) base00;
|
inherit (config.lib.stylix.colors.withHashtag) base00;
|
||||||
inherit (cfg) bloat gnome plasma container opacity fontSize graphical;
|
|
||||||
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
||||||
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji stdenvNoCC imagemagick;
|
|
||||||
inherit (builtins) attrValues;
|
inherit (builtins) attrValues;
|
||||||
|
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
mkMerge
|
||||||
|
mkOption
|
||||||
|
;
|
||||||
|
|
||||||
|
inherit (cfg)
|
||||||
|
bloat
|
||||||
|
gnome
|
||||||
|
plasma
|
||||||
|
container
|
||||||
|
opacity
|
||||||
|
fontSize
|
||||||
|
graphical
|
||||||
|
;
|
||||||
|
|
||||||
|
inherit (pkgs)
|
||||||
|
phinger-cursors
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
maple-mono
|
||||||
|
noto-fonts-emoji
|
||||||
|
stdenvNoCC
|
||||||
|
imagemagick
|
||||||
|
;
|
||||||
|
|
||||||
stylix-background = stdenvNoCC.mkDerivation {
|
stylix-background = stdenvNoCC.mkDerivation {
|
||||||
pname = "stylix-background";
|
pname = "stylix-background";
|
||||||
version = base00;
|
version = base00;
|
||||||
|
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [ imagemagick ];
|
||||||
imagemagick
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
@ -62,9 +90,7 @@ in
|
|||||||
thunar = {
|
thunar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
plugins = attrValues {
|
plugins = with pkgs.xfce; [ thunar-volman ];
|
||||||
inherit (pkgs.xfce) thunar-volman;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -91,7 +117,7 @@ in
|
|||||||
|
|
||||||
xserver = mkIf (!container || graphical) {
|
xserver = mkIf (!container || graphical) {
|
||||||
enable = true;
|
enable = true;
|
||||||
excludePackages = [ pkgs.xterm ];
|
excludePackages = with pkgs; [ xterm ];
|
||||||
};
|
};
|
||||||
|
|
||||||
pipewire = {
|
pipewire = {
|
||||||
@ -164,19 +190,19 @@ in
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "vagrant" ];
|
||||||
"vagrant"
|
|
||||||
];
|
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
enableDefaultPackages = false;
|
enableDefaultPackages = false;
|
||||||
|
|
||||||
packages = [
|
packages =
|
||||||
|
[
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
maple-mono
|
maple-mono
|
||||||
aleo-fonts
|
aleo-fonts
|
||||||
] ++ (with pkgs; [
|
]
|
||||||
|
++ (with pkgs; [
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk-serif
|
noto-fonts-cjk-serif
|
||||||
font-awesome
|
font-awesome
|
||||||
@ -187,9 +213,20 @@ in
|
|||||||
|
|
||||||
fontconfig = {
|
fontconfig = {
|
||||||
defaultFonts = {
|
defaultFonts = {
|
||||||
serif = [ "Noto Serif CJK JP" "Noto Serif" ];
|
serif = [
|
||||||
sansSerif = [ "Noto Sans CJK JP" "Noto Sans" ];
|
"Noto Serif CJK JP"
|
||||||
monospace = [ "Noto Sans Mono CJK JP" "Noto Sans Mono" ];
|
"Noto Serif"
|
||||||
|
];
|
||||||
|
|
||||||
|
sansSerif = [
|
||||||
|
"Noto Sans CJK JP"
|
||||||
|
"Noto Sans"
|
||||||
|
];
|
||||||
|
|
||||||
|
monospace = [
|
||||||
|
"Noto Sans Mono CJK JP"
|
||||||
|
"Noto Sans Mono"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
allowBitmaps = false;
|
allowBitmaps = false;
|
||||||
@ -244,13 +281,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
specialisation = {
|
specialisation = {
|
||||||
gnome = mkIf gnome {
|
gnome = mkIf gnome { configuration.imports = [ ../specializations/gnome.nix ]; };
|
||||||
configuration.imports = [ ../specializations/gnome.nix ];
|
plasma = mkIf plasma { configuration.imports = [ ../specializations/plasma.nix ]; };
|
||||||
};
|
|
||||||
|
|
||||||
plasma = mkIf plasma {
|
|
||||||
configuration.imports = [ ../specializations/plasma.nix ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,29 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf getExe singleton;
|
|
||||||
inherit (pkgs) piper interception-tools;
|
inherit (pkgs) piper interception-tools;
|
||||||
inherit (pkgs.interception-tools-plugins) dual-function-keys;
|
inherit (pkgs.interception-tools-plugins) dual-function-keys;
|
||||||
inherit (cfg) mouseSettings lidIgnore keyboardBinds bluetooth;
|
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
|
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
getExe
|
||||||
|
singleton
|
||||||
|
;
|
||||||
|
|
||||||
|
inherit (cfg)
|
||||||
|
mouseSettings
|
||||||
|
lidIgnore
|
||||||
|
keyboardBinds
|
||||||
|
bluetooth
|
||||||
|
;
|
||||||
|
|
||||||
dualFunctionKeysConfig = "dual-function-keys.yaml";
|
dualFunctionKeysConfig = "dual-function-keys.yaml";
|
||||||
|
|
||||||
cfg = config.modules.hardware;
|
cfg = config.modules.hardware;
|
||||||
@ -36,7 +53,8 @@ in
|
|||||||
plugins = [ dual-function-keys ];
|
plugins = [ dual-function-keys ];
|
||||||
|
|
||||||
udevmonConfig = toJSON (singleton {
|
udevmonConfig = toJSON (singleton {
|
||||||
JOB = /* bash */ ''
|
JOB = # bash
|
||||||
|
''
|
||||||
${interception-tools}/bin/intercept -g $DEVNODE |
|
${interception-tools}/bin/intercept -g $DEVNODE |
|
||||||
${getExe dual-function-keys} -c /etc/${dualFunctionKeysConfig} |
|
${getExe dual-function-keys} -c /etc/${dualFunctionKeysConfig} |
|
||||||
${interception-tools}/bin/uinput -d $DEVNODE
|
${interception-tools}/bin/uinput -d $DEVNODE
|
||||||
@ -44,7 +62,10 @@ in
|
|||||||
|
|
||||||
DEVICE = {
|
DEVICE = {
|
||||||
EVENTS = {
|
EVENTS = {
|
||||||
EV_KEY = [ "KEY_CAPSLOCK" "KEY_ESC" ];
|
EV_KEY = [
|
||||||
|
"KEY_CAPSLOCK"
|
||||||
|
"KEY_ESC"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -54,8 +54,6 @@ in
|
|||||||
rmlint
|
rmlint
|
||||||
jpegoptim
|
jpegoptim
|
||||||
pass
|
pass
|
||||||
;
|
|
||||||
inherit (pkgs)
|
|
||||||
sudachi-rs
|
sudachi-rs
|
||||||
tango
|
tango
|
||||||
npm-check-updates
|
npm-check-updates
|
||||||
@ -103,10 +101,6 @@ in
|
|||||||
nix-search-cli
|
nix-search-cli
|
||||||
nix-tree
|
nix-tree
|
||||||
;
|
;
|
||||||
inherit (pkgs)
|
|
||||||
nodejs
|
|
||||||
deno
|
|
||||||
;
|
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
rustc
|
rustc
|
||||||
rustfmt
|
rustfmt
|
||||||
@ -114,8 +108,8 @@ in
|
|||||||
cargo-tarpaulin
|
cargo-tarpaulin
|
||||||
bacon
|
bacon
|
||||||
clippy
|
clippy
|
||||||
;
|
nodejs
|
||||||
inherit (pkgs)
|
deno
|
||||||
tectonic
|
tectonic
|
||||||
;
|
;
|
||||||
})
|
})
|
||||||
|
@ -1,17 +1,38 @@
|
|||||||
{ nix-config, pkgs, lib, config, ... }:
|
{
|
||||||
|
nix-config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption mkEnableOption mkIf singleton;
|
|
||||||
inherit (lib.types) nullOr str listOf;
|
inherit (lib.types) nullOr str listOf;
|
||||||
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres;
|
|
||||||
inherit (builtins) attrValues;
|
inherit (lib)
|
||||||
|
mkOption
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
singleton
|
||||||
|
;
|
||||||
|
|
||||||
|
inherit (cfg)
|
||||||
|
username
|
||||||
|
iHaveLotsOfRam
|
||||||
|
hashedPassword
|
||||||
|
mullvad
|
||||||
|
allowSRB2Port
|
||||||
|
allowDevPort
|
||||||
|
noRoot
|
||||||
|
postgres
|
||||||
|
;
|
||||||
|
|
||||||
cfg = config.modules.system;
|
cfg = config.modules.system;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = attrValues {
|
imports = with nix-config.inputs.home-manager.nixosModules; [
|
||||||
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
|
home-manager
|
||||||
};
|
];
|
||||||
|
|
||||||
options.modules.system = {
|
options.modules.system = {
|
||||||
username = mkOption {
|
username = mkOption {
|
||||||
@ -36,7 +57,12 @@ in
|
|||||||
|
|
||||||
supportedLocales = mkOption {
|
supportedLocales = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ];
|
|
||||||
|
default = [
|
||||||
|
"ja_JP.UTF-8/UTF-8"
|
||||||
|
"en_US.UTF-8/UTF-8"
|
||||||
|
"fr_FR.UTF-8/UTF-8"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
stateVersion = mkOption {
|
stateVersion = mkOption {
|
||||||
@ -59,10 +85,7 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
boot = {
|
boot = {
|
||||||
tmp =
|
tmp = if iHaveLotsOfRam then { useTmpfs = true; } else { cleanOnBoot = true; };
|
||||||
if iHaveLotsOfRam
|
|
||||||
then { useTmpfs = true; }
|
|
||||||
else { cleanOnBoot = true; };
|
|
||||||
|
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|
||||||
@ -77,9 +100,7 @@ in
|
|||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
blacklistedKernelModules = [
|
blacklistedKernelModules = [ "floppy" ];
|
||||||
"floppy"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
@ -91,11 +112,15 @@ in
|
|||||||
package = pkgs.nixVersions.nix_2_22;
|
package = pkgs.nixVersions.nix_2_22;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
warn-dirty = false;
|
warn-dirty = false;
|
||||||
allow-import-from-derivation = false;
|
allow-import-from-derivation = false;
|
||||||
|
|
||||||
|
experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
trusted-users = [
|
trusted-users = [
|
||||||
"root"
|
"root"
|
||||||
"@wheel"
|
"@wheel"
|
||||||
@ -130,10 +155,12 @@ in
|
|||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
password = mkIf (hashedPassword == null && !noRoot) username;
|
password = mkIf (hashedPassword == null && !noRoot) username;
|
||||||
|
|
||||||
extraGroups =
|
extraGroups =
|
||||||
if noRoot
|
if noRoot then
|
||||||
then [ ]
|
[ ]
|
||||||
else [
|
else
|
||||||
|
[
|
||||||
"wheel"
|
"wheel"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"dialout"
|
"dialout"
|
||||||
@ -221,13 +248,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedUDPPorts = mkIf allowSRB2Port [
|
allowedUDPPorts = mkIf allowSRB2Port [ 5029 ];
|
||||||
5029
|
allowedTCPPorts = mkIf allowDevPort [ 3000 ];
|
||||||
];
|
|
||||||
|
|
||||||
allowedTCPPorts = mkIf allowDevPort [
|
|
||||||
3000
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -242,22 +264,14 @@ in
|
|||||||
|
|
||||||
postgresql = mkIf postgres {
|
postgresql = mkIf postgres {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
ensureUsers = singleton { name = username; };
|
||||||
ensureUsers = singleton {
|
|
||||||
name = username;
|
|
||||||
};
|
|
||||||
|
|
||||||
ensureDatabases = [ username ];
|
ensureDatabases = [ username ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [ (pass.withExtensions (ext: with ext; [ pass-otp ])) ];
|
||||||
(pass.withExtensions (ext: with ext; [ pass-otp ]))
|
|
||||||
];
|
|
||||||
|
|
||||||
defaultPackages = [ ];
|
defaultPackages = [ ];
|
||||||
|
|
||||||
gnome.excludePackages = with pkgs; [ gnome-tour ];
|
gnome.excludePackages = with pkgs; [ gnome-tour ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user