♻️ config refactor cleanup

This commit is contained in:
James Walker 2023-07-27 15:51:15 -04:00
parent d4b4ba1d1e
commit 19a01e278e
Signed by: walkah
GPG Key ID: 3C127179D6086E93
8 changed files with 22 additions and 31 deletions

View File

@ -37,7 +37,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# My stuff # My stuff
dotfiles = { dotfiles = {
url = "github:walkah/dotfiles"; url = "github:walkah/dotfiles";
@ -55,15 +54,17 @@
outputs = { self, nixpkgs, flake-utils, deploy-rs, pre-commit-hooks, workon, ... }@inputs: outputs = { self, nixpkgs, flake-utils, deploy-rs, pre-commit-hooks, workon, ... }@inputs:
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: { (system:
let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ self.overlays.default ]; overlays = [ self.overlays.default ];
config.allowUnfree = true;
}; };
checks = import ./nix/checks.nix { inherit self system pre-commit-hooks; }; in
devShells = import ./nix/shells.nix { inherit self system; }; {
formatter = self.pkgs.nixpkgs-fmt; checks = import ./nix/checks.nix { inherit self pkgs system pre-commit-hooks; };
devShells = import ./nix/shells.nix { inherit self pkgs system; };
formatter = pkgs.nixpkgs-fmt;
}) })
// { // {
hosts = import ./nix/hosts.nix; hosts = import ./nix/hosts.nix;

View File

@ -11,8 +11,6 @@
../../modules/sops ../../modules/sops
]; ];
nixpkgs.overlays = [ (import ../../overlays) ];
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default) # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf # Enables the generation of /boot/extlinux/extlinux.conf

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { { pkgs, ... }: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -23,9 +23,6 @@
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../../overlays) ];
nix.extraOptions = '' nix.extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';

View File

@ -18,8 +18,6 @@
../../modules/sops ../../modules/sops
]; ];
nixpkgs.overlays = [ (import ../../overlays) ];
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
# Set your time zone. # Set your time zone.

View File

@ -1,5 +1,4 @@
{ self, system, pre-commit-hooks, ... }: { self, pkgs, system, pre-commit-hooks, ... }:
with self.pkgs.${system};
{ {
pre-commit-check = pre-commit-hooks.lib.${system}.run { pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.; src = ./.;
@ -9,4 +8,4 @@ with self.pkgs.${system};
statix.enable = true; statix.enable = true;
}; };
}; };
} // (deploy-rs.lib.deployChecks self.deploy) } // (pkgs.deploy-rs.lib.deployChecks self.deploy)

View File

@ -10,7 +10,7 @@ let
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
(_: { (_: {
networking.hostName = hostName; networking.hostName = hostName;
nixpkgs.pkgs = self.pkgs.${hostSystem}; nixpkgs.overlays = [ self.overlays.default ];
}) })
] ++ modules; ] ++ modules;
specialArgs = { inherit dotfiles home-manager; }; specialArgs = { inherit dotfiles home-manager; };

View File

@ -10,7 +10,8 @@ let
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
(_: { (_: {
networking.hostName = hostName; networking.hostName = hostName;
nixpkgs.pkgs = self.pkgs.${hostSystem}; nixpkgs.overlays = [ self.overlays.default ];
nixpkgs.config.allowUnfree = true;
}) })
] ++ modules; ] ++ modules;
specialArgs = { inherit dotfiles nixos-hardware sops-nix; }; specialArgs = { inherit dotfiles nixos-hardware sops-nix; };

View File

@ -1,16 +1,13 @@
{ system, self, ... }: { system, pkgs, self, ... }:
with self.pkgs.${system};
let let
darwin-local = writeScriptBin "darwin-local" '' darwin-local = pkgs.writeScriptBin "darwin-local" ''
#!${stdenv.shell} #!${pkgs.stdenv.shell}
nix build .#darwinConfigurations.$(hostname -s).system nix build .#darwinConfigurations.$(hostname -s).system
./result/sw/bin/darwin-rebuild switch --flake . ./result/sw/bin/darwin-rebuild switch --flake .
''; '';
in in
{ {
default = mkShell { default = pkgs.mkShell {
name = "athens"; name = "athens";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
darwin-local darwin-local