Compare commits
20 Commits
0e3718ab22
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 507b4fcefd | |||
| f08d778a56 | |||
| aa1807e17c | |||
| 84ac992e26 | |||
| 45a0c0ccf5 | |||
| 362d9e744a | |||
| f6f505cc03 | |||
| 3b039c93ac | |||
| ce5062db24 | |||
| a8a45d3b02 | |||
| f9e2b676a5 | |||
| 29469b9c13 | |||
| 0dfc94e3d7 | |||
| a36df6e6a9 | |||
| aa20bae49c | |||
| d053a697bb | |||
| 254b47b835 | |||
| 5642978ea0 | |||
| f0e6cec173 | |||
| 3f8661d070 |
@@ -17,5 +17,8 @@ Some commits will require impure evaluation, although I will keep this to a mini
|
||||
Comments have been placed outside of filming to explain what parts of the code do,
|
||||
as this is a mostly "for reference" repo.
|
||||
|
||||
This repo also depends on [this hyprland config](https://git.voidarc.co.uk/adumh00man/hyprland-dendritic),
|
||||
which is self contained, but contains some more useful wrapper examples.
|
||||
|
||||
Any issues or typos or whatever can be reported via [email](mailto://admin@voidarc.co.uk)
|
||||
or [matrix](https://matrix.to/#/@admin:voidarc.co.uk). Lots of love <3
|
||||
|
||||
3
age.txt
Normal file
3
age.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# created: 2026-11-14T16:38:56Z
|
||||
# public key: age1xxeh8ju80rcct7k349jx338ylav04a44cnmp924plxnhkjvhmfcqmas62n
|
||||
AGE-SECRET-KEY-1WTP26ZUF85T79Q9VEQTP7U5L83M7QQHWFTUPXPPLY2YP6QYF8S2QCQ6XYU
|
||||
169
flake.lock
generated
169
flake.lock
generated
@@ -18,6 +18,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"wrappers": [
|
||||
"wrappers"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794672526,
|
||||
"narHash": "sha256-r6vKRLhiij+fNQdDY2XhmYH+KtqXDWTGEjUR28FFQ1c=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "24e78099cc14da3ee732719a6d5fdab150fa52c5",
|
||||
"revCount": 7,
|
||||
"type": "git",
|
||||
"url": "https://git.voidarc.co.uk/adumh00man/hyprland-dendritic"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.voidarc.co.uk/adumh00man/hyprland-dendritic"
|
||||
}
|
||||
},
|
||||
"import-tree": {
|
||||
"locked": {
|
||||
"lastModified": 1788467110,
|
||||
@@ -64,11 +87,155 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1792502884,
|
||||
"narHash": "sha256-IoNisKcGbUjdd45qCqywGMCYmZ5EnkxezvLII0FWwNA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "02c087f3fe673c9e317f206a627cb6b910336dbe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1787070829,
|
||||
"narHash": "sha256-vXNVDVtvfiQuXthP0NHPFdNvvMTkGpx0UP8oddIWbNk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0ae2bc1419c3f345984c2629e72e7a631820fa4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1786719841,
|
||||
"narHash": "sha256-QcpQOT0NQEFkI77t+YXPZqDJc35iIodG7zinieOwFUg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8be7bd0c83f12e2e3bbba07c9044d6fed9e66f7f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1791966044,
|
||||
"narHash": "sha256-t1hT8UW97rFCWCJO7/pClvu0AhLN5V3uir2M0ic4w/Q=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "319e4cebef10cbb636c6ea392137b52ad105336a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"wrappers": "wrappers"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787153199,
|
||||
"narHash": "sha256-FpLklQh5O31LY0GejnphNaGI/GZpuRltF9eZbAKlWkk=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "759a8455709d9c098a0201fb581801d41b270b29",
|
||||
"revCount": 105,
|
||||
"type": "git",
|
||||
"url": "https://git.voidarc.co.uk/voidarc/nvim"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.voidarc.co.uk/voidarc/nvim"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"hyprland": "hyprland",
|
||||
"import-tree": "import-tree",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nvim": "nvim",
|
||||
"sops-nix": "sops-nix",
|
||||
"wrappers": "wrappers_2"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794624949,
|
||||
"narHash": "sha256-3q/hxp/flW1PnV3Dx+H3p8kHGEHJ7251BqVMNsAAB9E=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "11e5885d241743ff0193465d533b20e754bc3ce0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wrappers": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786998037,
|
||||
"narHash": "sha256-QJ8QmuqmiOiHCT0HidqwlRpejNfCVcizLmLtzRWHWeQ=",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"rev": "780954265c11444ed0c9e164115360f4f5d24d0b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wrappers_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792532408,
|
||||
"narHash": "sha256-rasFTcWJo7CdUaCFcxcDTnMWlY6WxZo/X6EsbEqgIpM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"rev": "e40208b34e08f764e6b972eb0ee919706e960eb2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
23
flake.nix
23
flake.nix
@@ -5,9 +5,32 @@
|
||||
# Latest stable nixpkgs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||
|
||||
# Unstable nixpkgs
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
# Flake parts utils
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
import-tree.url = "github:vic/import-tree";
|
||||
|
||||
# My Nvim config
|
||||
nvim.url = "git+https://git.voidarc.co.uk/voidarc/nvim";
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Hyprland Configuration
|
||||
hyprland = {
|
||||
url = "git+https://git.voidarc.co.uk/adumh00man/hyprland-dendritic";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
wrappers.follows = "wrappers";
|
||||
};
|
||||
};
|
||||
|
||||
# Nix Wrapper Modules
|
||||
wrappers.url = "github:nix-community/nix-wrapper-modules";
|
||||
};
|
||||
|
||||
# Default import-tree output
|
||||
|
||||
27
modules/attrs/desktop/default.nix
Normal file
27
modules/attrs/desktop/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
moduleWithSystem,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
# Desktop Attribute, brings together all things you would need for a desktop
|
||||
|
||||
# Segmenting like this makes it easier to have different types of machines
|
||||
# Using the same config, like having a "laptop" attribute if you need different
|
||||
# packages there, etc.
|
||||
flake.nixosModules.desktop = moduleWithSystem ({pkgs, ...}: let
|
||||
modules = with self.nixosModules; [
|
||||
core
|
||||
networking
|
||||
hyprland
|
||||
theming
|
||||
sops
|
||||
];
|
||||
in {
|
||||
imports = modules;
|
||||
|
||||
# Add lazygit to every desktop
|
||||
environment.systemPackages = with pkgs; [
|
||||
lazygit
|
||||
];
|
||||
});
|
||||
}
|
||||
2
modules/features/bash/bashrc
Normal file
2
modules/features/bash/bashrc
Normal file
@@ -0,0 +1,2 @@
|
||||
export SOME="some"
|
||||
# other bash stuff
|
||||
27
modules/features/bash/default.nix
Normal file
27
modules/features/bash/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{inputs, ...}: {
|
||||
# PerSystem, gives access to self' and inputs', as well as some helper functions
|
||||
perSystem = {pkgs, ...}: {
|
||||
# Define packages as you would in a normal flake
|
||||
packages = {
|
||||
# Most basic package definition, gives #example output that runs pkgs.hello
|
||||
# All packages are outputs, and all outputs can be built, run and cached, etc.
|
||||
example = pkgs.hello;
|
||||
# Universal wrapper, use this to quickly add flags to a program
|
||||
bash = inputs.wrappers.lib.wrapPackage {
|
||||
# Always inherit pkgs
|
||||
inherit pkgs;
|
||||
# Set package, could be anything
|
||||
package = pkgs.bash;
|
||||
# Flag set, once again can be anything
|
||||
# Nix doesn't know what flags are valid, it will accept any two valid nix objects
|
||||
# Data types are irrelevant, can be paths, ints, bools, etc.
|
||||
flags = {
|
||||
"--rcfile" = ./bashrc;
|
||||
# to add the same flag twice, make the right hand side a set
|
||||
# "--someflag" = {"firstTime", "secondTime"}
|
||||
# You cannot repeat the left hand side
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
28
modules/features/foot/default.nix
Normal file
28
modules/features/foot/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
moduleWithSystem,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
flake.nixosModules.foot = moduleWithSystem ({self', ...}: {
|
||||
environment.systemPackages = with self'.packages; [
|
||||
foot
|
||||
];
|
||||
});
|
||||
# PerSystem, gives access to self' and inputs', as well as some helper functions
|
||||
perSystem = {pkgs, ...}: {
|
||||
# Simple wrapper for foot, sets background color to bright red
|
||||
packages.foot = let
|
||||
fira-mono = pkgs.nerd-fonts.fira-mono;
|
||||
font-config = pkgs.makeFontsConf {
|
||||
fontDirectories = [fira-mono];
|
||||
};
|
||||
in
|
||||
inputs.wrappers.wrappers.foot.wrap {
|
||||
inherit pkgs;
|
||||
env."FONTCONFIG_FILE" = "${font-config}";
|
||||
settings = {
|
||||
main.font = "FiraMono Nerd Font:size=18";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/features/hyprland/default.nix
Normal file
24
modules/features/hyprland/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{moduleWithSystem, ...}: {
|
||||
# moduleWithSystem for Hyprland
|
||||
flake.nixosModules.hyprland = moduleWithSystem ({self', ...}: {
|
||||
# Native wrapper for hyprland instead of environment.systemPackages
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = self'.packages.hyprland;
|
||||
};
|
||||
});
|
||||
perSystem = {
|
||||
inputs',
|
||||
pkgs,
|
||||
self',
|
||||
...
|
||||
}: {
|
||||
# Override input pacakge (using inputs' for right version)
|
||||
packages.hyprland = inputs'.hyprland.packages.default.override {
|
||||
# Change runtimePkgs to add custom foot version
|
||||
runtimePkgs = {
|
||||
foot = self'.packages.foot;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
22
modules/features/sops/default.nix
Normal file
22
modules/features/sops/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{inputs, ...}: {
|
||||
flake.nixosModules.sops = {
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.sops-nix.nixosModules.default];
|
||||
|
||||
sops = {
|
||||
age.keyFile = "/home/user01/Projects/dendritic-tutorial/age.txt";
|
||||
defaultSopsFile = ./secrets.yaml;
|
||||
|
||||
secrets = {
|
||||
secret = {};
|
||||
something = {};
|
||||
};
|
||||
templates = {
|
||||
"secret-value.env".content = "${config.sops.placeholder.something}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
17
modules/features/sops/secrets.yaml
Normal file
17
modules/features/sops/secrets.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
secret: ENC[AES256_GCM,data:2W9fC2QMVuctXc7kkX6a++ee,iv:igaTggUUKodYheKF4oxBwzfVjKJMAp/XNt+idd4xfek=,tag:Avv1hkngS7OAFAfMrbrD6A==,type:str]
|
||||
something: ENC[AES256_GCM,data:rNfYkLtWVEgvU9Xrfg==,iv:v6q7846C+fWKz0gOo2xWcb0SGkha+dJMTZ2/4+uud10=,tag:FZhiU7NuReIk4BLlnquMhA==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBUa0orV3o0Qm82MUo3NlNG
|
||||
YitrcGNUUWZQUkszc096VlI5SWxrTkxNdVZRCjZLelZaV1p2MzNDRjVNS3lNMnVw
|
||||
SWl5NkVHSWNrOHVaa3YySWVzZVhNcFEKLS0tIEdVU0RYY2ZDcUorK0cvT1lYTjhw
|
||||
ekE0QjBkSnVWYWE1LzN1VHphZWtWMHcKc83T1EyVzmQHtGA2Mdt4uRsYx89AbNkg
|
||||
Ng3b82VcxZQzR9HadM55MFy2BKGqpjOed+iBwesliU2JPcbkQb75dg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1xxeh8ju80rcct7k349jx338ylav04a44cnmp924plxnhkjvhmfcqmas62n
|
||||
lastmodified: "2026-11-14T16:43:47Z"
|
||||
mac: ENC[AES256_GCM,data:+RcPJKJrejXkEw17qmYDFSb62Cc4QxsQdZ1j7UkMaPenoebzgQl6kQIbPAlK14rDldmRnSGm0A3YOrB8Y6S0URu+H4R2e+PdXEo4xJKnIHfWufCmJj+k++d8Sueh3030JJuDJvjKGm6/l4/CkUDXELnVQGKlaF3Rux31ORHDvtI=,iv:1gEnVSC8r10qEMUATcoukvd0GuqxIYtXlJi+yirAl5k=,tag:Q3sOasF4i9wEySR02L4U1g==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.13.3
|
||||
92
modules/features/zsh/default.nix
Normal file
92
modules/features/zsh/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
inputs,
|
||||
# moduleWithSystem allows for using self' in modules
|
||||
moduleWithSystem,
|
||||
...
|
||||
}: {
|
||||
# enclose moduleWithSystem expression in (), so the final expression is one object
|
||||
flake.nixosModules.zsh = moduleWithSystem ({
|
||||
pkgs,
|
||||
# Self' allows accessing packages without having to point to the os string
|
||||
self',
|
||||
...
|
||||
}:
|
||||
# This is a "double expression", being written like {...}: {...}: {};
|
||||
# having an extra {...}. This is because the first attribute set only contains
|
||||
# flake parts attributes (self', flake.nixosModules, etc), and not nixos attributes.
|
||||
# The usual nixos attributes, like config, are passed into a potential second attribute
|
||||
# set, allowing you to access them there. This set is not implicit, and must be defined.
|
||||
# This means that the code can be read as:
|
||||
# {flake-parts attrs}: {nix attrs}: {actual expression};
|
||||
{config, ...}:
|
||||
# A let in statement allows setting of variables, in this case pointing any reference
|
||||
# of "lib" to "pkgs.lib". These can be stacked, and can be thought of as a way of
|
||||
# scoping variables.
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
in {
|
||||
# When the config or options objects are defined, nothing else can be in the expression.
|
||||
# Options contains a list of defined options, and config becomes the wrapper for everything
|
||||
# else in the expression. Imports works as expected.
|
||||
imports = [];
|
||||
options = {
|
||||
# Make a new option with lib.mkOption
|
||||
enableHighlighting = lib.mkOption {
|
||||
# Set type, eg bool, str, int. Custom types can be created
|
||||
type = lib.types.bool;
|
||||
# Default value is required
|
||||
default = false;
|
||||
# Description is optional but useful
|
||||
description = "Enable syntax highlighting";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# Nixpkgs overlay, replacing the universal "pkgs.zsh" with "self'.packages.zsh".
|
||||
# As stated, self' allows you to shorten the package definition from
|
||||
# self.${pkgs.stdenv.hostPlatform.system}.packages.zsh;
|
||||
# into just self'.packages.zsh, meaning package platform errors are almost impossible.
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
zsh = self'.packages.zsh;
|
||||
})
|
||||
];
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
# You can use config options through the config attribute, in place of a normal value,
|
||||
# the same way you can in other programming languages.
|
||||
enableSyntaxHighlighting = config.enableHighlighting;
|
||||
};
|
||||
};
|
||||
});
|
||||
# PerSystem should be defined in the same scope as flake.nixosModules
|
||||
perSystem = {
|
||||
# Inherited from inputs.nixpkgs
|
||||
pkgs,
|
||||
# Custom arg, see modules/system/nix-settings.nix
|
||||
unstablePkgs,
|
||||
# Same principle of self', removes need for direct reference to os-string
|
||||
inputs',
|
||||
# Helper, points to pkgs.lib
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Defined wrapper for zsh, docs are on nix-wrapper modules site
|
||||
packages.zsh = inputs.wrappers.wrappers.zsh.wrap {
|
||||
# Pkgs MUST be defined, always inherit pkgs in a wrapper
|
||||
inherit pkgs;
|
||||
zshAliases = {
|
||||
# By making an alias reference a package, zsh becomes dependant on that package.
|
||||
# This idea allows for fully portable modules with implicit dependancy trees
|
||||
some = lib.getExe unstablePkgs.vim;
|
||||
v = lib.getExe inputs'.nvim.packages.default;
|
||||
ff = lib.getExe pkgs.fastfetch;
|
||||
cat = lib.getExe pkgs.bat;
|
||||
secret = "cat /run/secrets/secret-value";
|
||||
};
|
||||
# Can also be zshrc.path, and path will take precedence over content.
|
||||
zshrc.content = ''
|
||||
export SOME=some
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
# Define modules to import
|
||||
modules = with self.nixosModules; [
|
||||
hostConfiguration
|
||||
system
|
||||
desktop
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,16 @@
|
||||
# Define modules to import
|
||||
modules = with self.nixosModules; [
|
||||
newHostConfiguration
|
||||
system
|
||||
desktop
|
||||
zsh
|
||||
|
||||
# Change config options in this object
|
||||
# This can be done per-host with different options,
|
||||
# allowing for smaller changes to modules' functionality
|
||||
# Without having to create a whole new module
|
||||
({...}: {
|
||||
enableHighlighting = true;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
25
modules/system/core/default.nix
Normal file
25
modules/system/core/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{self, ...}: {
|
||||
# This module acts as a collection of other modules, for ease
|
||||
# of use. Adding another module to this list will import it
|
||||
# for all other modules that import this one.
|
||||
|
||||
# Keep in mind that you cannot import this module alongside
|
||||
# any of its children. For example, importing this module and
|
||||
# the user module in the same block is the same as importing
|
||||
# the user module twice, leading to an error due to trying
|
||||
# to define the same user twice.
|
||||
|
||||
# Collections should be used for static lists of modules, like
|
||||
# those that would make up a basic system, as seen here.
|
||||
|
||||
# Define flake part nixosModule "core"
|
||||
flake.nixosModules.core = {...}: let
|
||||
modules = with self.nixosModules; [
|
||||
user
|
||||
bootloader
|
||||
imports
|
||||
];
|
||||
in {
|
||||
imports = modules;
|
||||
};
|
||||
}
|
||||
23
modules/system/core/nix-settings.nix
Normal file
23
modules/system/core/nix-settings.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{inputs, ...}: {
|
||||
# PerSystem, allows for universal module access
|
||||
perSystem = {system, ...}: {
|
||||
# Pre-defined object
|
||||
_module.args = {
|
||||
# Custom object, creating a new nixpkgs from a different input
|
||||
unstablePkgs = import inputs.nixpkgs-unstable {
|
||||
inherit system;
|
||||
};
|
||||
|
||||
# Another example not in the video, creating an unfree instance of nixpkgs
|
||||
# Setting nixpkgs.config.free = true isn't possible through a normal nixosModule,
|
||||
# because of how inheritance works with nixos exclusive objects
|
||||
unfreePkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
# You can also set universal variables here, if you need to access the same info across files
|
||||
someVariable = "import this as you would import pkgs, in a perSystem block";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{self, ...}: {
|
||||
# This module acts as a collection of other modules, for ease
|
||||
# of use. Adding another module to this list will import it
|
||||
# for all other modules that import this one.
|
||||
|
||||
# Keep in mind that you cannot import this module alongside
|
||||
# any of its children. For example, importing this module and
|
||||
# the user module in the same block is the same as importing
|
||||
# the user module twice, leading to an error due to trying
|
||||
# to define the same user twice.
|
||||
|
||||
# Collections should be used for static lists of modules, like
|
||||
# those that would make up a basic system, as seen here.
|
||||
|
||||
# Define flake part nixosModule "system"
|
||||
flake.nixosModules.system = {...}: let
|
||||
modules = with self.nixosModules; [
|
||||
user
|
||||
networking
|
||||
bootloader
|
||||
imports
|
||||
];
|
||||
in {
|
||||
imports = modules;
|
||||
};
|
||||
}
|
||||
42
modules/system/theming/default.nix
Normal file
42
modules/system/theming/default.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{moduleWithSystem, ...}: {
|
||||
flake.nixosModules.theming = moduleWithSystem ({pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(catppuccin-gtk.override {
|
||||
accents = ["mauve"];
|
||||
size = "compact";
|
||||
tweaks = ["rimless"];
|
||||
variant = "mocha";
|
||||
})
|
||||
(catppuccin-papirus-folders.override {
|
||||
accent = "mauve";
|
||||
})
|
||||
bibata-cursors
|
||||
nwg-look
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
XCURSOR_THEME = "Bibata-Modern-Ice";
|
||||
XCURSOR_SIZE = "20";
|
||||
};
|
||||
|
||||
programs = {
|
||||
xfconf.enable = true;
|
||||
dconf = {
|
||||
enable = true;
|
||||
profiles.user.databases = [
|
||||
{
|
||||
lockAll = false;
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
gtk-theme = "catppuccin-mocha-mauve-compact+rimless";
|
||||
icon-theme = "Papirus";
|
||||
color-scheme = "prefer-dark";
|
||||
cursor-name = "Bibata-Modern-Ice";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user