♻️ 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";
};
# My stuff
dotfiles = {
url = "github:walkah/dotfiles";
@ -55,16 +54,18 @@
outputs = { self, nixpkgs, flake-utils, deploy-rs, pre-commit-hooks, workon, ... }@inputs:
flake-utils.lib.eachDefaultSystem
(system: {
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
config.allowUnfree = true;
};
checks = import ./nix/checks.nix { inherit self system pre-commit-hooks; };
devShells = import ./nix/shells.nix { inherit self system; };
formatter = self.pkgs.nixpkgs-fmt;
})
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
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;
overlays.default = nixpkgs.lib.composeManyExtensions [

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
{ self, system, pre-commit-hooks, ... }:
with self.pkgs.${system};
{ self, pkgs, system, pre-commit-hooks, ... }:
{
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
@ -9,4 +8,4 @@ with self.pkgs.${system};
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
(_: {
networking.hostName = hostName;
nixpkgs.pkgs = self.pkgs.${hostSystem};
nixpkgs.overlays = [ self.overlays.default ];
})
] ++ modules;
specialArgs = { inherit dotfiles home-manager; };

View File

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

View File

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