Skip to content

Commit

Permalink
refactor for nixfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yomaq committed Aug 14, 2024
1 parent e8e509c commit c59b233
Show file tree
Hide file tree
Showing 123 changed files with 4,156 additions and 3,416 deletions.
11 changes: 6 additions & 5 deletions Utilities/devenv/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{ pkgs, lib, ... }:
{
{ pkgs, lib, ... }:
{
env = {
GREET = "Yomaq's Home Flake";
};

# https://github.com/cachix/devenv/issues/528
containers = lib.mkForce {};
containers = lib.mkForce { };

packages = with pkgs; [
_1password
nixfmt-rfc-style
];

enterShell = ''
echo $GREET
'';
'';

scripts = {
# remove nix system gernerations older than 7 days
Expand Down Expand Up @@ -118,4 +119,4 @@
nix run github:numtide/nixos-anywhere -- --flake .#$hostname root@$ipaddress
'';
};
}
}

This file was deleted.

This file was deleted.

218 changes: 126 additions & 92 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "nix config";
inputs = {
# Nixpkgs
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-24.05";
Expand Down Expand Up @@ -39,104 +39,138 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, nix-darwin, nixos-generators, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
"aarch64-darwin"
];
imports = [
inputs.devenv.flakeModule
];
perSystem = { config, self', inputs', pkgs, system, ... }: {
# flake's own devenv
devenv.shells.default = { imports = [ ./Utilities/devenv/default.nix ]; };
};
# non-flake.parts outputs
flake = {
overlays = import ./modules/overlays {inherit inputs;};
### Host outputs
# NixOS configuration entrypoint
# Available through 'nixos-rebuild switch --flake .#your-hostname'
nixosConfigurations = {
blue = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/blue ];
outputs =
{
self,
nixpkgs,
home-manager,
nix-darwin,
nixos-generators,
flake-parts,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
"aarch64-darwin"
];
imports = [ inputs.devenv.flakeModule ];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
# flake's own devenv
devenv.shells.default = {
imports = [ ./Utilities/devenv/default.nix ];
};
};
azure = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/azure ];
# non-flake.parts outputs
flake = {
overlays = import ./modules/overlays { inherit inputs; };
### Host outputs
# NixOS configuration entrypoint
# Available through 'nixos-rebuild switch --flake .#your-hostname'
nixosConfigurations = {
blue = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/blue ];
};
azure = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/azure ];
};
carob = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/carob ];
};
teal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/teal ];
};
smalt = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/smalt ];
};
# green = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = { inherit inputs; };
# modules = [ ./hosts/green ];
# };
pearl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/pearl ];
};
};
carob = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/carob ];
# Nix-darwin configuration entrypoint
# Available through 'darwin-rebuild switch --flake .#your-hostname'
darwinConfigurations = {
midnight = nix-darwin.lib.darwinSystem {
specialArgs = {
inherit inputs;
};
system = "aarch64-darwin";
modules = [ ./hosts/midnight ];
};
};
teal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/teal ];
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"carln@hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
inherit inputs;
};
modules = [ ./users/carln/homeManager ];
};
};
smalt = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/smalt ];
# Nixos-generators configuration entrypoints
# Available through 'nix build .#your-hostname'
packages.x86_64-linux = {
#### requires --impure, breaks `nix flake check`
# install-iso = nixos-generators.nixosGenerate {
# system = "x86_64-linux";
# format = "install-iso";
# specialArgs = { inherit inputs; };
# modules = [ ./hosts/install-iso ];
# };
};
# green = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = { inherit inputs; };
# modules = [ ./hosts/green ];
# };
pearl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/pearl ];
### Module outputs
nixosModules = {
yomaq = import ./modules/hosts/nixos.nix;
# custom container modules
pods = import ./modules/containers;
};
};
# Nix-darwin configuration entrypoint
# Available through 'darwin-rebuild switch --flake .#your-hostname'
darwinConfigurations = {
midnight = nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs; };
system = "aarch64-darwin";
modules = [ ./hosts/midnight ];
darwinModules = {
yomaq = import ./modules/hosts/darwin.nix;
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"carln@hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs;};
modules = [./users/carln/homeManager];
homeManagerModules = {
yomaq = import ./modules/home-manager;
};
};
# Nixos-generators configuration entrypoints
# Available through 'nix build .#your-hostname'
packages.x86_64-linux = {
#### requires --impure, breaks `nix flake check`
# install-iso = nixos-generators.nixosGenerate {
# system = "x86_64-linux";
# format = "install-iso";
# specialArgs = { inherit inputs; };
# modules = [ ./hosts/install-iso ];
# };
};
### Module outputs
nixosModules = {
yomaq = import ./modules/hosts/nixos.nix;
# custom container modules
pods = import ./modules/containers;
};
darwinModules = {
yomaq = import ./modules/hosts/darwin.nix;
};
homeManagerModules = {
yomaq = import ./modules/home-manager;
};
};
};
}
}
Loading

0 comments on commit c59b233

Please sign in to comment.