Compare commits

..

No commits in common. "bd88d8382c70f6a5b0e8518d78fb64af2172a9f3" and "f9fd542206d64ec7b2fdf67a7c89a973f7eefd69" have entirely different histories.

39 changed files with 279 additions and 317 deletions

View File

@ -980,7 +980,8 @@
"nvim-treesitter-textsubjects": "nvim-treesitter-textsubjects",
"pre-commit-hooks": "pre-commit-hooks",
"smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable"
"stable": "stable",
"utils": "utils"
}
},
"rust-overlay": {
@ -1082,6 +1083,26 @@
"type": "github"
}
},
"utils": {
"inputs": {
"flake-utils": [
"flake-utils"
]
},
"locked": {
"lastModified": 1657226504,
"narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {

149
flake.nix
View File

@ -13,6 +13,8 @@
stable.url = "github:nixos/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
utils.inputs.flake-utils.follows = "flake-utils";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
@ -77,51 +79,58 @@
Outputs
*/
outputs = inputs@{ self, nixpkgs, ... }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
outputs =
inputs@{ self, nixpkgs, utils, ... }:
utils.lib.mkFlake {
inherit self inputs;
forEachSystem = lib.genAttrs systems;
supportedSystems = [ "x86_64-linux" ];
channelsConfig.allowUnfree = true;
lib = nixpkgs.lib.extend
(self: _: { my = import ./lib { lib = self; }; });
/*
Overlays
*/
overlay = import ./overlays {
inherit inputs;
inherit (self) lib;
};
config.allowUnfree = true;
overlays = [
channels.nixpkgs.overlaysBuilder = _: [
inputs.hypr-contrib.overlays.default
inputs.hyprland.overlays.default
inputs.neovim-nightly-overlay.overlay
overlay
inputs.utils.overlay
self.overlay
];
pkgsFor = system: import nixpkgs {
inherit system config;
overlays = overlays ++ [
(
_: prev: {
master = import inputs.master {
inherit (prev) system;
inherit overlays config;
};
stable = import inputs.stable {
inherit (prev) system;
inherit overlays config;
};
}
)
overlay
];
overlays = utils.lib.exportOverlays
{
inherit (self) pkgs inputs;
} // {
default = self.overlay;
};
defaultModules = [
{ nixpkgs = { inherit config; }; }
./modules
/*
Modules
*/
nixosModules = utils.lib.exportModules [
./modules/profiles/base.nix
./modules/profiles/gaming.nix
./modules/profiles/desktop.nix
./modules/profiles/personal.nix
];
hostDefaults.modules = [
./modules/default.nix
self.nixosModules.base
inputs.home-manager.nixosModule
{
home-manager = {
@ -133,22 +142,40 @@
inputs.agenix.nixosModules.age
];
hosts = self.lib.my.mapModules
(path:
let
system = import "${path}/system.nix";
pkgs = pkgsFor system;
in
lib.nixosSystem {
inherit pkgs system lib;
specialArgs = {
inherit inputs;
};
modules = defaultModules ++ [ path ];
})
./hosts;
pre-commit-check = system: inputs.pre-commit-hooks.lib."${system}".run {
hosts.nixos-laptop.modules = [
./hosts/nixos-laptop
self.nixosModules.desktop
self.nixosModules.personal
];
hosts.nixos-desktop.modules = [
./hosts/nixos-desktop
self.nixosModules.desktop
self.nixosModules.gaming
self.nixosModules.personal
];
/*
Other Outputs
*/
outputsBuilder = channels:
with channels.nixpkgs; {
devShells.default = mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
name = "dotfiles";
packages = [
# Secrets
pkgs.agenix
# cachix
cachix
];
};
checks.pre-commit-check = inputs.pre-commit-hooks.lib."${system}".run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
@ -157,42 +184,8 @@
stylua.enable = true;
};
};
in
with lib; {
inherit lib;
pkgs = genAttrs systems pkgsFor;
# ╔══════════════════════════════════════════════════════════╗
# ║ NixOS Configurations ║
# ╚══════════════════════════════════════════════════════════╝
nixosConfigurations = hosts;
# ╔══════════════════════════════════════════════════════════╗
# ║ Other Outputs ║
# ╚══════════════════════════════════════════════════════════╝
devShells = forEachSystem (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell
{
inherit (pre-commit-check system) shellHook;
name = "dotfiles";
packages = with pkgs; [
# Secrets
agenix
# cachix
cachix
];
packages = utils.lib.exportPackages self.overlays channels;
};
});
checks = forEachSystem (system: {
pre-commit-check = pre-commit-check system;
});
};
}

View File

@ -10,13 +10,7 @@
# Include the results of the hardware scan.
./hardware-configuration.nix
];
my = {
profiles = {
desktop.enable = true;
gaming.enable = true;
personal.enable = true;
};
programs.hyprland.nvidiaSupport = true;
services.mullvad.enable = true;
programs.ledger.enable = true;

View File

@ -1 +0,0 @@
"x86_64-linux"

View File

@ -10,11 +10,6 @@
./hardware-configuration.nix
];
my.profiles = {
desktop.enable = true;
personal.enable = true;
};
# BOOT
boot = {
supportedFilesystems = [ "btrfs" ];

View File

@ -1 +0,0 @@
"x86_64-linux"

View File

@ -47,34 +47,4 @@ lib.makeExtensible (_: rec {
mapModules' = f: dir: lib.attrValues (mapModules f dir);
listModules = mapModules' (path: path);
mapModulesRec = f: dir:
let
filterDirs = name: type:
let
isPublic = !(lib.hasPrefix "_" name);
isSomething = type != null;
isDir = type == "directory";
isDefault = isDir && builtins.pathExists "${toString dir}/${name}/default.nix";
in
isPublic && isSomething && isDir && !isDefault;
subDirs = lib.filterAttrs filterDirs (builtins.readDir dir);
mkSubModule = name: _:
let
path = "${toString dir}/${name}";
in
lib.nameValuePair name (mapModulesRec f path);
in
mapModules f dir //
(lib.mapAttrs' mkSubModule subDirs);
mapModulesRec' = f: dir:
let
attrValuesRec = attrs: map (values: if lib.isAttrs values then attrValuesRec values else values) (lib.attrValues attrs);
in
lib.flatten (attrValuesRec (mapModulesRec f dir));
listModulesRec = mapModulesRec' (path: path);
})

View File

@ -7,10 +7,10 @@
with lib;
let
cfg = config.my.bin;
cycleSinks = import ./_cycleSinks.nix { inherit pkgs; };
protonge = import ./_protonge.nix { inherit pkgs; };
share = import ./_share.nix { inherit pkgs; };
sxhkdHelp = import ./_sxhkdHelp.nix { inherit pkgs; };
cycleSinks = import ./cycleSinks.nix { inherit pkgs; };
protonge = import ./protonge.nix { inherit pkgs; };
share = import ./share.nix { inherit pkgs; };
sxhkdHelp = import ./sxhkdHelp.nix { inherit pkgs; };
in
{
options.my.bin.enable = mkEnableOption "bin";

View File

@ -0,0 +1,5 @@
{ lib, ... }:
{
imports = lib.my.listModules ./.;
}

View File

@ -6,7 +6,7 @@ let
in
{
config = mkIf (cfg.enable && cfg.scheme == "catppuccin-frappe")
(import ./_catppuccin.nix
(import ./catppuccin.nix
{
inherit config lib pkgs;
flavor = "mocha";

View File

@ -6,7 +6,7 @@ let
in
{
config = mkIf (cfg.enable && cfg.scheme == "catppuccin-latte")
(import ./_catppuccin.nix
(import ./catppuccin.nix
{
inherit config lib pkgs;
flavor = "mocha";

View File

@ -6,7 +6,7 @@ let
in
{
config = mkIf (cfg.enable && cfg.scheme == "catppuccin-macchiato")
(import ./_catppuccin.nix
(import ./catppuccin.nix
{
inherit config lib pkgs;
flavor = "mocha";

View File

@ -6,7 +6,7 @@ let
in
{
config = mkIf (cfg.enable && cfg.scheme == "catppuccin-mocha")
(import ./_catppuccin.nix
(import ./catppuccin.nix
{
inherit config lib pkgs;
flavor = "mocha";

View File

Before

Width:  |  Height:  |  Size: 12 MiB

After

Width:  |  Height:  |  Size: 12 MiB

View File

Before

Width:  |  Height:  |  Size: 5.2 MiB

After

Width:  |  Height:  |  Size: 5.2 MiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 4.6 MiB

View File

Before

Width:  |  Height:  |  Size: 10 MiB

After

Width:  |  Height:  |  Size: 10 MiB

View File

Before

Width:  |  Height:  |  Size: 501 KiB

After

Width:  |  Height:  |  Size: 501 KiB

View File

Before

Width:  |  Height:  |  Size: 635 KiB

After

Width:  |  Height:  |  Size: 635 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -1,4 +1,9 @@
{ lib, ... }:
{
imports = lib.my.listModulesRec ./.;
imports = [
./config
./programs
./security
./services
./virtualisation
];
}

View File

@ -1,17 +1,8 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.desktop;
in
{
options.my.profiles.desktop.enable = mkEnableOption "desktop profile";
config = mkIf cfg.enable {
with lib; {
my = {
yubikey = {
enable = mkDefault true;
@ -79,5 +70,4 @@ in
pulse.enable = true;
};
};
};
}

View File

@ -1,17 +1,6 @@
{ lib
, config
, pkgs
{ pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.gaming;
in
{
options.my.profiles.gaming.enable = mkEnableOption "Enable gaming profile";
config = mkIf cfg.enable {
}: {
programs.steam.enable = true;
environment.systemPackages = with pkgs; [
lutris
@ -19,5 +8,4 @@ in
heroic
mangohud
];
};
}

View File

@ -1,17 +1,7 @@
{ lib
, config
, ...
}:
{ lib, ... }:
with lib;
let
cfg = config.my.profiles.personal;
in
{
options.my.profiles.personal.enable = mkEnableOption "personal profile";
config = mkIf cfg.enable
{
my = {
services = {
openconnect.enable = true;
@ -70,5 +60,4 @@ in
};
};
};
};
}

View File

@ -1,23 +1,10 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.ripping;
in
{ pkgs }:
{
options.my.profiles.ripping.enable = mkEnableOption "ripping profile";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# ripping
abcde
handbrake
picard
];
};
}

View File

@ -0,0 +1,5 @@
{ lib, ... }:
{
imports = lib.my.listModules ./.;
}

View File

@ -48,7 +48,7 @@ in
enable = true;
package = hyprland;
recommendedEnvironment = true;
extraConfig = import ./_config.nix args;
extraConfig = import ./config.nix args;
};
};

View File

@ -0,0 +1,5 @@
{ lib, ... }:
{
imports = lib.my.listModules ./.;
}

View File

@ -0,0 +1,5 @@
{ lib, ... }:
{
imports = lib.my.listModules ./.;
}

12
overlays/channels.nix Normal file
View File

@ -0,0 +1,12 @@
{ inputs, ... }:
_: prev: {
master = import inputs.master {
inherit (prev) system;
config.allowUnfree = true;
};
stable = import inputs.stable {
inherit (prev) system;
config.allowUnfree = true;
};
}