yep, more dotfiles

feat,refactor: change to a base24 theme, update nix-colors, change the way i pass extra args to module

+3 -3
apps/flash-installer.nix
···
-
{ self, system, lib, writeShellApplication, ... }@pkgs:
with lib;
let
-
inherit (self.inputs) nixpkgs;
-
iso = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit self; }; modules = [ ../nixos/profiles/installer.nix ]; };
# Build installer ISO
isoPath = "${iso.config.system.build.isoImage}/iso/${iso.config.isoImage.isoName}";
···
+
{ self, lib, writeShellApplication, ... }@pkgs:
with lib;
let
+
inherit (self.outputs) flakeLib;
+
iso = flakeLib.createSystem pkgs [ ../nixos/profiles/installer.nix ];
# Build installer ISO
isoPath = "${iso.config.system.build.isoImage}/iso/${iso.config.isoImage.isoName}";
+28 -28
flake.lock
···
"base16-schemes": {
"flake": false,
"locked": {
-
"lastModified": 1689473676,
-
"narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=",
"owner": "tinted-theming",
"repo": "base16-schemes",
-
"rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1704741201,
-
"narHash": "sha256-Y420NeqPWRSpxHpXsxhKILfTxT5exjtTgCgDwSpcEfU=",
"owner": "nix-community",
"repo": "disko",
-
"rev": "f0a3425a7b173701922e7959d8bfb136ef53aa54",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1704099619,
-
"narHash": "sha256-QRVMkdxLmv+aKGjcgeEg31xtJEIsYq4i1Kbyw5EPS6g=",
"owner": "nix-community",
"repo": "home-manager",
-
"rev": "7e398b3d76bc1503171b1364c9d4a07ac06f3851",
"type": "github"
},
"original": {
···
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
-
"lastModified": 1695388192,
-
"narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=",
"owner": "misterio77",
"repo": "nix-colors",
-
"rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c",
"type": "github"
},
"original": {
···
},
"nixos-hardware": {
"locked": {
-
"lastModified": 1704786394,
-
"narHash": "sha256-aJM0ln9fMGWw1+tjyl5JZWZ3ahxAA2gw2ZpZY/hkEMs=",
"owner": "nixos",
"repo": "nixos-hardware",
-
"rev": "b34a6075e9e298c4124e35c3ccaf2210c1f3a43b",
"type": "github"
},
"original": {
···
},
"nixpkgs-lib": {
"locked": {
-
"lastModified": 1694911725,
-
"narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
-
"rev": "819180647f428a3826bfc917a54449da1e532ce0",
"type": "github"
},
"original": {
···
},
"nixpkgs-unstable": {
"locked": {
-
"lastModified": 1704722960,
-
"narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=",
"owner": "nixos",
"repo": "nixpkgs",
-
"rev": "317484b1ead87b9c1b8ac5261a8d2dd748a0492d",
"type": "github"
},
"original": {
···
},
"nixpkgs_2": {
"locked": {
-
"lastModified": 1704732714,
-
"narHash": "sha256-ABqK/HggMYA/jMUXgYyqVAcQ8QjeMyr1jcXfTpSHmps=",
"owner": "nixos",
"repo": "nixpkgs",
-
"rev": "6723fa4e4f1a30d42a633bef5eb01caeb281adc3",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1704898994,
-
"narHash": "sha256-v0+4gdcd5GjnMZGs6D77szQ1fEu0CICgDezT2N63edM=",
"ref": "refs/heads/master",
-
"rev": "2e781b1efdbca8781c43b43e350cf17fce8d6750",
-
"revCount": 1605,
"type": "git",
"url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5"
},
···
"base16-schemes": {
"flake": false,
"locked": {
+
"lastModified": 1696158499,
+
"narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=",
"owner": "tinted-theming",
"repo": "base16-schemes",
+
"rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a",
"type": "github"
},
"original": {
···
]
},
"locked": {
+
"lastModified": 1707524024,
+
"narHash": "sha256-HmumZ8FuWAAYZrWUKm3N4G4h8nmZ5VUVX+vXLmCJNKM=",
"owner": "nix-community",
"repo": "disko",
+
"rev": "d07de570ba05cec2807d058daaa044f6955720c7",
"type": "github"
},
"original": {
···
]
},
"locked": {
+
"lastModified": 1706981411,
+
"narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
"owner": "nix-community",
"repo": "home-manager",
+
"rev": "652fda4ca6dafeb090943422c34ae9145787af37",
"type": "github"
},
"original": {
···
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
+
"lastModified": 1706637303,
+
"narHash": "sha256-K6SqE9diWDCoEQ+MzuVlTfNrAKcdIa/dLHBtKfz445U=",
"owner": "misterio77",
"repo": "nix-colors",
+
"rev": "fc080c51d2a219b40d886870e364243783ed5ca1",
"type": "github"
},
"original": {
···
},
"nixos-hardware": {
"locked": {
+
"lastModified": 1707211557,
+
"narHash": "sha256-LTKTzZ6fM5j8XWXf51IMBzDaOaJg9kYWLUZxoIhzRN8=",
"owner": "nixos",
"repo": "nixos-hardware",
+
"rev": "6e5cc385fc8cf5ca6495d70243074ccdea9f64c7",
"type": "github"
},
"original": {
···
},
"nixpkgs-lib": {
"locked": {
+
"lastModified": 1697935651,
+
"narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
+
"rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902",
"type": "github"
},
"original": {
···
},
"nixpkgs-unstable": {
"locked": {
+
"lastModified": 1707546158,
+
"narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=",
"owner": "nixos",
"repo": "nixpkgs",
+
"rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0",
"type": "github"
},
"original": {
···
},
"nixpkgs_2": {
"locked": {
+
"lastModified": 1707650010,
+
"narHash": "sha256-dOhphIA4MGrH4ElNCy/OlwmN24MsnEqFjRR6+RY7jZw=",
"owner": "nixos",
"repo": "nixpkgs",
+
"rev": "809cca784b9f72a5ad4b991e0e7bcf8890f9c3a6",
"type": "github"
},
"original": {
···
]
},
"locked": {
+
"lastModified": 1707742994,
+
"narHash": "sha256-TXUY4cCxqNgvy5CzsVbt4MHvfw3qc8n90GMapcwPoN0=",
"ref": "refs/heads/master",
+
"rev": "9767b485c2aad1e23097d2b5165287ba84cfa452",
+
"revCount": 1687,
"type": "git",
"url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5"
},
+9 -3
flake.nix
···
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nix-colors.url = "github:misterio77/nix-colors";
nixos-hardware.url = "github:nixos/nixos-hardware";
···
inherit (self) outputs;
inherit (nixpkgs.lib) genAttrs;
-
forAllSystems = genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
flakeLib = import ./lib/flake (nixpkgs // { inherit self; });
pkgs = forAllSystems (system: (import nixpkgs {
inherit system;
config.allowUnfreePredicate = import ./lib/unfree.nix;
···
homeManagerModules = import ./modules/home-manager;
templates = import ./templates;
nixosConfigurations = with flakeLib; {
-
"neo-wiro-laptop" = createSystem [
(system "neo-wiro-laptop" "laptop")
(managedDiskLayout "luks-btrfs" { device = "nvme0n1"; swapSize = 12; })
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; })
];
-
"archaic-wiro-laptop" = createSystem [
(system "archaic-wiro-laptop" "laptop")
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; })
];
···
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
+
# TODO: replace with a custom module, this just acts as a module definition
nix-colors.url = "github:misterio77/nix-colors";
nixos-hardware.url = "github:nixos/nixos-hardware";
···
inherit (self) outputs;
inherit (nixpkgs.lib) genAttrs;
+
forAllSystems = genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
flakeLib = import ./lib/flake (nixpkgs // { inherit self; });
+
# This sould be the only constructed nixpkgs instance in this flake
pkgs = forAllSystems (system: (import nixpkgs {
inherit system;
config.allowUnfreePredicate = import ./lib/unfree.nix;
···
homeManagerModules = import ./modules/home-manager;
templates = import ./templates;
+
# Custom exports
+
inherit flakeLib;
+
lib = forAllSystems (system: import ./lib pkgs.${system});
+
nixosConfigurations = with flakeLib; {
+
"neo-wiro-laptop" = createSystem pkgs."x86_64-linux" [
(system "neo-wiro-laptop" "laptop")
(managedDiskLayout "luks-btrfs" { device = "nvme0n1"; swapSize = 12; })
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; })
];
+
"archaic-wiro-laptop" = createSystem pkgs."x86_64-linux" [
(system "archaic-wiro-laptop" "laptop")
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; })
];
+1 -1
home-manager/modules/vm/default.nix
···
let
inherit (self.outputs) homeManagerModules;
-
theme = config.colorScheme.colors;
swayCfg = config.wayland.windowManager.sway.config;
workspacesRange = zipListsWith (num: ws: { inherit ws num; }) [ 1 2 3 4 5 6 7 8 9 0 ] (range 1 10);
···
let
inherit (self.outputs) homeManagerModules;
+
theme = config.colorScheme.palette;
swayCfg = config.wayland.windowManager.sway.config;
workspacesRange = zipListsWith (num: ws: { inherit ws num; }) [ 1 2 3 4 5 6 7 8 9 0 ] (range 1 10);
+1 -1
home-manager/modules/vm/search.nix
···
with lib;
let
-
theme = config.colorScheme.colors;
keyValueFormat = lib.generators.toKeyValue { };
in
{
···
with lib;
let
+
theme = config.colorScheme.palette;
keyValueFormat = lib.generators.toKeyValue { };
in
{
+2 -2
home-manager/modules/vm/swaybar.nix
···
with lib;
let
-
theme = config.colorScheme.colors;
in
{
options = { };
···
config = {
programs.i3status-rust = {
enable = true;
-
bars.default = rec {
theme = "modern";
icons = "awesome6";
blocks = [
···
with lib;
let
+
theme = config.colorScheme.palette;
in
{
options = { };
···
config = {
programs.i3status-rust = {
enable = true;
+
bars.default = {
theme = "modern";
icons = "awesome6";
blocks = [
+4 -30
home-manager/profiles/desktop.nix
···
{ self
, lib
, config
, pkgs
# Provides the NixOS configuration if HM was loaded through the NixOS module
···
let
inherit (self.inputs) agenix nix-colors;
-
inherit (self.outputs) overlays;
tomlFormat = pkgs.formats.toml { };
in
···
# Nix colors
nix-colors.homeManagerModules.default
-
{ colorScheme = nix-colors.colorSchemes.onedark; }
../modules/vm
../modules/git.nix
···
];
config = {
-
nixpkgs = {
-
overlays = [ overlays.all ];
-
config.allowUnfreePredicate = import ../../lib/unfree.nix;
-
};
-
programs.home-manager.enable = osConfig == null;
home = {
···
element-desktop
gnome.gnome-disk-utility
imv
mpv
transmission-gtk
audacity
libreoffice-qt
# Needed for libreoffice
···
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
-
};
-
-
programs.topgrade = {
-
enable = true;
-
package = pkgs.unstable.topgrade;
-
settings = {
-
misc = {
-
# Don't ask for confirmations
-
assume_yes = true;
-
-
# Run `sudo -v` to cache credentials at the start of the run; this avoids a
-
# blocking password prompt in the middle of a possibly-unattended run.
-
pre_sudo = true;
-
-
skip_notify = true;
-
disable = [ "rustup" ];
-
no_retry = true;
-
cleanup = true;
-
};
-
-
# TODO: sepcify via global config
-
git.repos = [ "~/Developement/*/*" "~/.config/dotfiles" ];
-
};
};
};
}
···
{ self
, lib
+
, llib
, config
, pkgs
# Provides the NixOS configuration if HM was loaded through the NixOS module
···
let
inherit (self.inputs) agenix nix-colors;
tomlFormat = pkgs.formats.toml { };
in
···
# Nix colors
nix-colors.homeManagerModules.default
+
{ config.colorScheme = llib.colorSchemes.oneDark; }
../modules/vm
../modules/git.nix
···
];
config = {
programs.home-manager.enable = osConfig == null;
home = {
···
element-desktop
gnome.gnome-disk-utility
imv
+
(lutris.override { extraPkgs = pkgs: [ winetricks vulkan-loader ]; })
mpv
transmission-gtk
audacity
+
libreoffice-qt
# Needed for libreoffice
···
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
};
};
}
+37
lib/colorSchemes.nix
···
···
+
{
+
# Found in <https://github.com/tinted-theming/schemes/blob/spec-0.11/base24/one-dark.yaml>
+
# Transformed using `yaml2nix`
+
oneDark = {
+
name = "One Dark";
+
author = "FredHappyface (https://github.com/FredHappyface)";
+
variant = "dark";
+
# system = "base24";
+
palette = {
+
base00 = "282c34";
+
base01 = "3f4451";
+
base02 = "4f5666";
+
base03 = "545862";
+
base04 = "9196a1";
+
base05 = "abb2bf";
+
base06 = "e6e6e6";
+
base07 = "ffffff";
+
base08 = "e05561";
+
base09 = "d18f52";
+
base0A = "e6b965";
+
base0B = "8cc265";
+
base0C = "42b3c2";
+
base0D = "4aa5f0";
+
base0E = "c162de";
+
base0F = "bf4034";
+
base10 = "21252b";
+
base11 = "181a1f";
+
base12 = "ff616e";
+
base13 = "f0a45d";
+
base14 = "a5e075";
+
base15 = "4cd1e0";
+
base16 = "4dc4ff";
+
base17 = "de73ff";
+
};
+
};
+
+
}
+4 -2
lib/default.nix
···
-
# This will be merged with nixpkgs' lib
-
pkgs: { }
···
+
# This flake library is available to modules via the `llib` arg
+
pkgs: {
+
colorSchemes = import ./colorSchemes.nix;
+
}
+17 -4
lib/flake/default.nix
···
-
{ self, lib, ... }@pkgs:
with lib;
{
-
createSystem = modules: nixosSystem {
-
specialArgs = { inherit self; };
-
inherit modules;
};
system = hostName: profile: {
···
+
{ self, lib, ... }:
with lib;
+
let
+
inherit (self.inputs) nixpkgs-unstable;
+
in
{
+
# Makes
+
# - flake accessible through `self`
+
# - local flake library accessible through `llib`
+
# - unstable nixpkgs set accessible through `upkgs`
+
specialModuleArgs = pkgs: {
+
inherit self;
+
llib = import ../. pkgs;
+
upkgs = import nixpkgs-unstable { inherit (pkgs) system config; };
+
};
+
+
createSystem = pkgs: modules: nixosSystem {
+
inherit pkgs modules;
+
specialArgs = self.flakeLib.specialModuleArgs pkgs;
};
system = hostName: profile: {
+2 -2
lib/flake/user.nix
···
} // user;
home-manager = {
-
extraSpecialArgs = { inherit self; };
useUserPackages = false;
-
useGlobalPkgs = false;
users.${name} = import ../../home-manager/profiles/${profile}.nix;
};
···
} // user;
home-manager = {
+
extraSpecialArgs = self.flakeLib.specialModuleArgs pkgs;
useUserPackages = false;
+
useGlobalPkgs = true;
users.${name} = import ../../home-manager/profiles/${profile}.nix;
};
+5 -7
nixos/hardware/archaic-wiro-laptop.nix
···
-
{ config
-
, lib
-
, pkgs
-
, modulesPath
-
, ...
-
}: {
-
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config = {
local.screen = {
width = 1920;
···
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
}
···
+
{ config, lib, ... }:
+
{
config = {
local.screen = {
width = 1920;
···
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+
# Replaces `<modules>/installer/scan/not-detected.nix` import
+
hardware.enableRedistributableFirmware = lib.mkDefault true;
};
}
+4 -3
nixos/hardware/neo-wiro-laptop.nix
···
-
{ self, config, lib, pkgs, modulesPath, ... }:
let
inherit (self.outputs) nixosModules;
in
{
imports = [
-
"${modulesPath}/installer/scan/not-detected.nix"
-
# Patches ACPI tables to fix sound issue
nixosModules.hardware.asus.zenbook.ux3402za.sound
];
···
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
}
···
+
{ self, config, lib, ... }:
let
inherit (self.outputs) nixosModules;
in
{
imports = [
# Patches ACPI tables to fix sound issue
nixosModules.hardware.asus.zenbook.ux3402za.sound
];
···
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+
# Replaces `<modules>/installer/scan/not-detected.nix` import
+
hardware.enableRedistributableFirmware = lib.mkDefault true;
};
}
-9
nixos/modules/nix.nix
···
{ self
, lib
, config
-
, pkgs
, ...
}:
with lib;
-
let
-
inherit (self.outputs) overlays;
-
in
{
config = {
-
nixpkgs = {
-
overlays = [ overlays.all ];
-
config.allowUnfreePredicate = import ../../lib/unfree.nix;
-
};
-
nix = {
# Make system registry consistent with flake inputs
# Add `self` registry input that refers to flake
···
{ self
, lib
, config
, ...
}:
with lib;
{
config = {
nix = {
# Make system registry consistent with flake inputs
# Add `self` registry input that refers to flake
+2
nixos/modules/virtualisation.nix
···
};
virtualisation.waydroid.enable = true;
};
}
···
};
virtualisation.waydroid.enable = true;
+
+
services.flatpak.enable = true;
};
}
+1 -2
nixos/profiles/installer.nix
···
with lib;
let
-
inherit (self.inputs) disko;
-
inherit (pkgs) writeShellScriptBin writeShellApplication pastebinit;
binName = drv: drv.meta.mainProgram;
···
with lib;
let
+
inherit (pkgs) writeShellScriptBin pastebinit;
binName = drv: drv.meta.mainProgram;
+3 -14
overlays/default.nix
···
}:
let
-
inherit (self.inputs) nixpkgs-unstable;
inherit (lib) composeManyExtensions;
in
rec {
# Bundles all overlays, order matters here
-
all = composeManyExtensions [ addFlakeAsSelf localLib additions patches unstablePackages ];
-
# Passing our flake as `self` makes it easy to access inputs and outputs
-
addFlakeAsSelf = final: prev: { inherit self; };
-
-
# Merge our local library to nixpkgs'
-
localLib = final: prev: {
-
lib = { local = import ../lib final; } // prev.lib;
-
};
# Bring our custom packages from the `pkgs` directory
additions = final: prev: import ../pkgs prev;
# Custom derivation patches that temporarily fix a package
patches = import ./patches.nix;
-
-
# Makes the unstable nixpkgs set accessible through `pkgs.unstable`
-
unstablePackages = final: prev: {
-
unstable = import nixpkgs-unstable { inherit (final) system config; };
-
};
}
···
}:
let
inherit (lib) composeManyExtensions;
in
rec {
# Bundles all overlays, order matters here
+
all = composeManyExtensions [ bringSpecialArgs additions patches ];
+
# Bring `self`, `llib` and `upkgs`
+
bringSpecialArgs = final: prev: self.flakeLib.specialModuleArgs final;
# Bring our custom packages from the `pkgs` directory
additions = final: prev: import ../pkgs prev;
# Custom derivation patches that temporarily fix a package
patches = import ./patches.nix;
}