Skip to content

Commit

Permalink
Move overlays into separate folder and clean up
Browse files Browse the repository at this point in the history
Inspired by misterio777, I moved the overlays into their own folder and
cleaned the configuration up! A lot of the configuration was made when
the flake config just started, so I wasn't aware what things did. Now,
with some new knowledge, the I think I understand it!
  • Loading branch information
arunoruto committed Oct 18, 2024
1 parent 397ae7a commit aa2a3b8
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 82 deletions.
132 changes: 50 additions & 82 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,65 +95,6 @@
# image = "anime/jjk/satoru-gojo-jujutsu-kaisen-5k-ac.jpg";
# image = "anime/gruvbox/skull2.png";
image = "anime/gruvbox/boonies.png";
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config.nvidia.acceptLicense = true;
};
};
nixpkgs-config = {
nixpkgs = {
config.allowUnfree = true;
overlays = [
overlay-unstable
# nur.overlay
(final: prev: {
# neovim = inputs.nixvim-flake.packages.${system}.default;
})
];
};
};
pkgs = import nixpkgs {
inherit system;
overlays = [
overlay-unstable
(final: prev: {
# neovim = inputs.nixvim-flake.packages.${system}.default;
})
# make unstable packages available via overlay
# (final: prev: {
# unstable = nixpkgs-unstable.legacyPackages.${prev.system};
# })
];
};
nixos-modules = [
nixpkgs-config
nur.nixosModules.nur
{
theming = {
inherit scheme;
inherit image;
};
}
];
home-manager-modules = [
# {
# nixpkgs.overlays = [
# neorg-overlay.overlays.default
# ];
# }
# nixvim.homeManagerModules.nixvim
nur.hmModules.nur
./modules/home-manager/home.nix
inputs.stylix.homeManagerModules.stylix
{
theming = {
inherit scheme;
inherit image;
};
}
];

hostname-users = {
# Personal
Expand All @@ -174,44 +115,71 @@
inherit inputs;
username = hostname-users."${hostname}";
};
modules =
nixos-modules
++ [
{networking.hostName = nixpkgs.lib.mkForce hostname;}
modules = [
nur.nixosModules.nur
{
networking.hostName = nixpkgs.lib.mkForce hostname;
nixpkgs = {
config.allowUnfree = true;
overlays = [
self.overlays.additions
self.overlays.unstable-packages
];
};
theming = {
inherit scheme;
inherit image;
};
}
./hosts/${hostname}
home-manager.nixosModules.home-manager
./homes
];
];
});

homeConfigurations = nixpkgs.lib.genAttrs (nixpkgs.lib.lists.unique (builtins.attrValues hostname-users)) (user:
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = home-manager-modules;
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.unstable-packages
];
};
modules = [
nur.hmModules.nur
./modules/home-manager/home.nix
inputs.stylix.homeManagerModules.stylix
{
theming = {
inherit scheme;
inherit image;
};
}
];
extraSpecialArgs = {
inherit inputs;
inherit user;
# user = user;
};
});

packages.${system} = import ./pkgs nixpkgs.legacyPackages.${system};
overlays = import ./overlays {inherit inputs;};

devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
cmake
glib
stdenv.cc.cc.lib
zlib
];
# devShells.${system}.default = pkgs.mkShell {
# buildInputs = with pkgs; [
# cmake
# glib
# stdenv.cc.cc.lib
# zlib
# ];

shellHook = ''
# export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [pkgs.glib pkgs.stdenv.cc.cc.lib pkgs.zlib]}:''$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [pkgs.glib pkgs.stdenv.cc.cc.lib pkgs.zlib]}
# https://github.com/python-poetry/poetry/issues/8623#issuecomment-1793624371
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
echo "Flake Env"
'';
};
# shellHook = ''
# # export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [pkgs.glib pkgs.stdenv.cc.cc.lib pkgs.zlib]}:''$LD_LIBRARY_PATH
# export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [pkgs.glib pkgs.stdenv.cc.cc.lib pkgs.zlib]}
# # https://github.com/python-poetry/poetry/issues/8623#issuecomment-1793624371
# export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
# echo "Flake Env"
# '';
# };
};
}
31 changes: 31 additions & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file defines overlays
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;

# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};

# custom nvim for the future maybe?
# (final: prev: {
# # neovim = inputs.nixvim-flake.packages.${system}.default;
# })

# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config = {
allowUnfree = true;
nvidia.acceptLicense = true;
};
};
};
}

0 comments on commit aa2a3b8

Please sign in to comment.