Skip to content

Commit

Permalink
fix(flake): Remove unused outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Jan 7, 2025
1 parent ac8065c commit daf3c52
Showing 1 changed file with 101 additions and 127 deletions.
228 changes: 101 additions & 127 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
catppuccin.url = "github:catppuccin/nix";
tokyonight.url = "github:mrjones2014/tokyonight.nix";
flake-utils.url = "github:numtide/flake-utils";
wezterm-nightly = {
url = "github:wez/wezterm?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -48,138 +47,113 @@
keep-derivations = true;
};

outputs = inputs@{ self, nixpkgs, home-manager, agenix, flake-utils, ... }:
{
nixosConfigurations = {
server = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = true;
isLinux = true;
isThinkpad = false;
isDarwin = false;
};
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{
environment.systemPackages =
[ agenix.packages.x86_64-linux.default ];
}
./nixos-modules/common.nix
./hosts/server
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/server.nix;
extraSpecialArgs = {
inherit inputs;
isServer = true;
isLinux = true;
isThinkpad = false;
isDarwin = false;
};
};
}
];
outputs = inputs@{ self, nixpkgs, home-manager, agenix, ... }: {
nixosConfigurations = {
server = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = true;
isLinux = true;
isThinkpad = false;
isDarwin = false;
};
pc = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = false;
};
system = "x86_64-linux";
modules = [
./nixos-modules/common.nix
./hosts/pc
home-manager.nixosModules.home-manager
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = false;
};
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{
environment.systemPackages =
[ agenix.packages.x86_64-linux.default ];
}
./nixos-modules/common.nix
./hosts/server
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/server.nix;
extraSpecialArgs = {
inherit inputs;
isServer = true;
isLinux = true;
isThinkpad = false;
isDarwin = false;
};
}
];
};
}
];
};
pc = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = false;
};
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = true;
};
system = "x86_64-linux";
modules = [
./nixos-modules/common.nix
./hosts/laptop
home-manager.nixosModules.home-manager
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = true;
};
system = "x86_64-linux";
modules = [
./nixos-modules/common.nix
./hosts/pc
home-manager.nixosModules.home-manager
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = false;
};
}
];
};
}
];
};
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = true;
};
system = "x86_64-linux";
modules = [
./nixos-modules/common.nix
./hosts/laptop
home-manager.nixosModules.home-manager
{
home-manager = {
backupFileExtension = "backup";
useUserPackages = true;
users.mat = import ./home-manager/home.nix;
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = false;
isLinux = true;
isThinkpad = true;
};
};
}
];
};
homeConfigurations = {
"mac" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = true;
isLinux = false;
isThinkpad = false;
};
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
modules = [ ./home-manager/home.nix ];
};
homeConfigurations = {
"mac" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
isServer = false;
isDarwin = true;
isLinux = false;
isThinkpad = false;
};
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
modules = [ ./home-manager/home.nix ];
};
} // inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

packages = nixpkgs.lib.filterAttrs
(_: pkg: builtins.any (x: x == system) pkg.meta.platforms)
(import ./packages {
inherit pkgs;
inherit inputs;
});

checksForConfigs = configs: extract:
nixpkgs.lib.attrsets.filterAttrs (_: p: p.system == system)
(nixpkgs.lib.attrsets.mapAttrs (_: extract) configs);
in {
inherit packages;

checks = nixpkgs.lib.lists.foldl nixpkgs.lib.attrsets.unionOfDisjoint
packages [
(checksForConfigs self.homeConfigurations
(hm: hm.activationPackage))
(checksForConfigs self.nixosConfigurations
(c: c.config.system.build.toplevel))
];
});
};
};
}

0 comments on commit daf3c52

Please sign in to comment.