mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 19:17:45 +00:00
Clean up flake
This commit is contained in:
parent
2cc888498d
commit
b2f5ff1ee3
12 changed files with 120 additions and 92 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -154,7 +154,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-super": {
|
||||
"nixSuper": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"libgit2": "libgit2",
|
||||
|
@ -262,7 +262,7 @@
|
|||
"homeManager": "homeManager",
|
||||
"hyprland": "hyprland",
|
||||
"hyprpicker": "hyprpicker",
|
||||
"nix-super": "nix-super",
|
||||
"nixSuper": "nixSuper",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"themes": "themes",
|
||||
"tools": "tools"
|
||||
|
@ -386,4 +386,4 @@
|
|||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
}
|
156
flake.nix
156
flake.nix
|
@ -1,6 +1,35 @@
|
|||
{
|
||||
description = "All my NixOS configurations.";
|
||||
|
||||
# nixConfig = with builtins; mapAttrs (_: concatStringsSep " ") {
|
||||
# extra-substituters = [
|
||||
# "https://nix-community.cachix.org/"
|
||||
# "https://hyprland.cachix.org/"
|
||||
# "https://cache.privatevoid.net/"
|
||||
# ];
|
||||
|
||||
# extra-trusted-public-keys = [
|
||||
# "nix-community.cachix.org:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
# "hyprland.cachix.org:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
# "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg="
|
||||
# ];
|
||||
# };
|
||||
|
||||
# inputs = with builtins; mapAttrs (name: url: {
|
||||
# url = "git+https://${url}";
|
||||
# } // (if elem name [ "nixSuper" "hyprland" "hyprpicker" ] then {} else {
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# })) {
|
||||
# nixSuper = "github.com/privatevoid-net/nix-super";
|
||||
# nixpkgs = "github.com/NixOS/nixpkgs/tree/nixos-unstable";
|
||||
# homeManager = "github.com/nix-community/home-manager";
|
||||
# hyprland = "github.com/hyprwm/Hyprland";
|
||||
# hyprpicker = "github.com/hyprwm/hyprpicker";
|
||||
# fenix = "github.com/nix-community/fenix";
|
||||
# tools = "github.com/RGBCube/FlakeTools";
|
||||
# themes = "github.com/RGBCube/ThemeNix";
|
||||
# };
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = ''
|
||||
https://nix-community.cachix.org/
|
||||
|
@ -20,7 +49,7 @@
|
|||
url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
nix-super = {
|
||||
nixSuper = {
|
||||
url = "github:privatevoid-net/nix-super";
|
||||
};
|
||||
|
||||
|
@ -29,6 +58,19 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
url = "github:hyprwm/Hyprland";
|
||||
};
|
||||
|
||||
hyprpicker = {
|
||||
url = "github:hyprwm/hyprpicker";
|
||||
};
|
||||
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
tools = {
|
||||
url = "github:RGBCube/FlakeTools";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -37,49 +79,23 @@
|
|||
themes = {
|
||||
url = "github:RGBCube/ThemeNix";
|
||||
};
|
||||
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
url = "github:hyprwm/Hyprland";
|
||||
};
|
||||
|
||||
hyprpicker = {
|
||||
url = "github:hyprwm/hyprpicker";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, nix-super, homeManager, tools, themes, fenix, ... } @ inputs: tools.eachDefaultLinuxArch (system: let
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixSuper,
|
||||
nixpkgs,
|
||||
homeManager,
|
||||
fenix,
|
||||
tools,
|
||||
themes,
|
||||
...
|
||||
}: tools.eachDefaultLinuxArch (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
upkgs = {
|
||||
theme = themes.custom (themes.raw.gruvbox-dark-hard // {
|
||||
corner-radius = 12;
|
||||
border-width = 3;
|
||||
|
||||
font.size.normal = 12;
|
||||
font.size.big = 18;
|
||||
|
||||
font.sans.name = "Lexend";
|
||||
font.sans.package = pkgs.lexend;
|
||||
|
||||
font.mono.name = "RobotoMono Nerd Font";
|
||||
font.mono.package = (pkgs.nerdfonts.override {
|
||||
fonts = [
|
||||
"RobotoMono"
|
||||
];
|
||||
});
|
||||
|
||||
icons.name = "Gruvbox-Plus-Dark";
|
||||
icons.package = pkgs.callPackage (import ./derivations/gruvbox-icons.nix) {};
|
||||
});
|
||||
|
||||
hyprland = inputs.hyprland.packages.${system}.default;
|
||||
hyprpicker = inputs.hyprpicker.packages.${system}.default;
|
||||
};
|
||||
upkgs = tools.recursiveUpdateMap (name: {
|
||||
${name} = inputs.${name}.packages.${system}.default;
|
||||
}) [ "hyprland" "hyprpicker" ];
|
||||
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
|
@ -89,18 +105,29 @@
|
|||
recursiveUpdate3 = x: y: z: lib.recursiveUpdate x (lib.recursiveUpdate y z);
|
||||
};
|
||||
|
||||
theme = themes.custom (themes.raw.gruvbox-dark-hard // {
|
||||
corner-radius = 12;
|
||||
border-width = 3;
|
||||
|
||||
font.size.normal = 12;
|
||||
font.size.big = 18;
|
||||
|
||||
font.sans.name = "Lexend";
|
||||
font.sans.package = pkgs.lexend;
|
||||
|
||||
font.mono.name = "RobotoMono Nerd Font";
|
||||
font.mono.package = (pkgs.nerdfonts.override { fonts = [ "RobotoMono" ]; });
|
||||
|
||||
icons.name = "Gruvbox-Plus-Dark";
|
||||
icons.package = pkgs.callPackage (import ./derivations/gruvbox-icons.nix) {};
|
||||
});
|
||||
|
||||
abstractions = rec {
|
||||
importAll = paths: {
|
||||
imports = paths;
|
||||
};
|
||||
imports = paths: lib.genAttrs [ "imports" ] (_: paths);
|
||||
|
||||
enabled = attributes: attributes // {
|
||||
enable = true;
|
||||
};
|
||||
enabled = attributes: attributes // { enable = true; };
|
||||
|
||||
normalUser = attributes: attributes // {
|
||||
isNormalUser = true;
|
||||
};
|
||||
normalUser = attributes: attributes // { isNormalUser = true; };
|
||||
|
||||
systemConfiguration = attributes: attributes;
|
||||
|
||||
|
@ -113,9 +140,9 @@
|
|||
};
|
||||
|
||||
homeConfiguration = user: attributes: systemConfiguration {
|
||||
home-manager.users = builtins.foldl' lib.recursiveUpdate {} (builtins.map (user: {
|
||||
home-manager.users = tools.recursiveUpdateMap (user: {
|
||||
${user} = attributes;
|
||||
}) (if builtins.isList user then user else [ user ]));
|
||||
}) (if builtins.isList user then user else [ user ]);
|
||||
};
|
||||
|
||||
homePackages = user: packages: homeConfiguration user {
|
||||
|
@ -131,25 +158,25 @@
|
|||
persistent = true;
|
||||
};
|
||||
|
||||
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
||||
|
||||
nix.settings.trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
nix.registry = {
|
||||
nixpkgs.flake = nixpkgs;
|
||||
default.flake = nixpkgs;
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||
|
||||
nix.settings.warn-dirty = false;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.overlays = [
|
||||
fenix.overlays.default
|
||||
nix-super.overlays.default
|
||||
nixSuper.overlays.default
|
||||
];
|
||||
|
||||
programs.nix-ld = enabled {};
|
||||
|
@ -159,12 +186,13 @@
|
|||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
networking.hostName = host;
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
};
|
||||
|
||||
specialArgs = abstractions // {
|
||||
inherit upkgs ulib;
|
||||
inherit upkgs ulib theme;
|
||||
};
|
||||
|
||||
importConfigurations = tools.recursiveUpdateMap (host: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ upkgs, homeConfiguration, enabled, ... }:
|
||||
{ theme, homeConfiguration, enabled, ... }:
|
||||
|
||||
homeConfiguration [ "nixos" "root" ] {
|
||||
programs.nushell.environmentVariables = {
|
||||
|
@ -11,8 +11,8 @@ homeConfiguration [ "nixos" "root" ] {
|
|||
less = "bat --plain";
|
||||
};
|
||||
|
||||
programs.bat = with upkgs.theme; enabled {
|
||||
programs.bat = enabled {
|
||||
config.theme = "default";
|
||||
themes.default = tmTheme;
|
||||
themes.default = theme.tmTheme;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ulib, systemConfiguration, homeConfiguration, importAll, ... }: ulib.recursiveUpdate3
|
||||
{ pkgs, ulib, systemConfiguration, homeConfiguration, imports, ... }: ulib.recursiveUpdate3
|
||||
|
||||
(systemConfiguration {
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
@ -15,7 +15,7 @@
|
|||
home.stateVersion = "23.05";
|
||||
})
|
||||
|
||||
(importAll [
|
||||
(imports [
|
||||
./bat
|
||||
./blueman
|
||||
./discord
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, pkgs, upkgs, homeConfiguration, homePackages, ... }: lib.recursiveUpdate
|
||||
{ lib, pkgs, theme, homeConfiguration, homePackages, ... }: lib.recursiveUpdate
|
||||
|
||||
(homeConfiguration "nixos" {
|
||||
xdg.configFile."Vencord/settings/quickCss.css".text = upkgs.theme.discordCss;
|
||||
xdg.configFile."Vencord/settings/quickCss.css".text = theme.discordCss;
|
||||
})
|
||||
|
||||
(with pkgs; homePackages "nixos" [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ upkgs, homeConfiguration, enabled, ... }:
|
||||
{ theme, homeConfiguration, enabled, ... }:
|
||||
|
||||
homeConfiguration "nixos" {
|
||||
services.dunst = with upkgs.theme.withHashtag; enabled {
|
||||
services.dunst = with theme.withHashtag; enabled {
|
||||
iconTheme = icons;
|
||||
|
||||
settings.global = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, pkgs, upkgs, systemConfiguration, systemFonts, ... }: lib.recursiveUpdate
|
||||
{ lib, pkgs, theme, systemConfiguration, systemFonts, ... }: lib.recursiveUpdate
|
||||
|
||||
(systemConfiguration {
|
||||
console = {
|
||||
|
@ -11,8 +11,8 @@
|
|||
})
|
||||
|
||||
(with pkgs; systemFonts [
|
||||
upkgs.theme.font.sans.package
|
||||
upkgs.theme.font.mono.package
|
||||
theme.font.sans.package
|
||||
theme.font.mono.package
|
||||
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ upkgs, homeConfiguration, enabled, ... }:
|
||||
{ theme, homeConfiguration, enabled, ... }:
|
||||
|
||||
homeConfiguration "nixos" {
|
||||
programs.fuzzel = with upkgs.theme; enabled {
|
||||
programs.fuzzel = with theme; enabled {
|
||||
settings.main = {
|
||||
dpi-aware = false;
|
||||
font = "${font.sans.name}:size=${toString font.size.big}";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, pkgs, upkgs, systemConfiguration, homeConfiguration, enabled, ... }: lib.recursiveUpdate
|
||||
{ lib, pkgs, theme, systemConfiguration, homeConfiguration, enabled, ... }: lib.recursiveUpdate
|
||||
|
||||
(systemConfiguration {
|
||||
programs.dconf = enabled {};
|
||||
|
@ -6,16 +6,16 @@
|
|||
|
||||
(homeConfiguration "nixos" {
|
||||
gtk = enabled {
|
||||
gtk3.extraCss = upkgs.theme.adwaitaGtkCss;
|
||||
gtk4.extraCss = upkgs.theme.adwaitaGtkCss;
|
||||
gtk3.extraCss = theme.adwaitaGtkCss;
|
||||
gtk4.extraCss = theme.adwaitaGtkCss;
|
||||
|
||||
font = with upkgs.theme.font; {
|
||||
font = with theme.font; {
|
||||
inherit (sans) name package;
|
||||
|
||||
size = size.normal;
|
||||
};
|
||||
|
||||
iconTheme = upkgs.theme.icons;
|
||||
iconTheme = theme.icons;
|
||||
|
||||
theme = {
|
||||
name = "Adwaita-dark";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, upkgs, ulib, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: ulib.recursiveUpdate3
|
||||
{ pkgs, upkgs, ulib, theme, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: ulib.recursiveUpdate3
|
||||
|
||||
(systemConfiguration {
|
||||
hardware.opengl = enabled {};
|
||||
|
@ -11,7 +11,7 @@
|
|||
})
|
||||
|
||||
(homeConfiguration "nixos" {
|
||||
wayland.windowManager.hyprland = with upkgs.theme; enabled {
|
||||
wayland.windowManager.hyprland = with theme; enabled {
|
||||
package = upkgs.hyprland;
|
||||
|
||||
extraConfig =
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ upkgs, homeConfiguration, enabled, ... }:
|
||||
{ theme, homeConfiguration, enabled, ... }:
|
||||
|
||||
homeConfiguration "nixos" {
|
||||
programs.kitty = with upkgs.theme.withHashtag; enabled {
|
||||
programs.kitty = with theme.withHashtag; enabled {
|
||||
font = with font; {
|
||||
inherit (mono) name package;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ upkgs, homeConfiguration, enabled, ... }:
|
||||
{ theme, homeConfiguration, enabled, ... }:
|
||||
|
||||
homeConfiguration "nixos" {
|
||||
programs.waybar = with upkgs.theme.withHashtag; enabled {
|
||||
programs.waybar = with theme.withHashtag; enabled {
|
||||
systemd = enabled {};
|
||||
|
||||
settings = [{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue