mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Initial restructure of flake.nix
- Added nixpkgs-unstable input - Added disko input - Made nixosSystem & darwinSystem reusable with parameters - Switched darwinConfigurations to use parameterized darwinSystem - Switched nixosConfigurations to use parameterized darwinSystem
This commit is contained in:
parent
e3d1b896c2
commit
7d7a958da9
2 changed files with 125 additions and 68 deletions
153
flake.nix
153
flake.nix
|
|
@ -4,6 +4,7 @@
|
|||
# Where we get most of our software. Giant mono repo with recipes
|
||||
# called derivations that say how to build software.
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
# Controls system level software and settings including fonts
|
||||
nix-darwin = {
|
||||
|
|
@ -20,6 +21,12 @@
|
|||
# Manage Homebrew itself
|
||||
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
||||
|
||||
# Format disks with nix-config
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# My oh-my-posh theme
|
||||
genebean-omp-themes = {
|
||||
url = "github:genebean/my-oh-my-posh-themes";
|
||||
|
|
@ -27,78 +34,90 @@
|
|||
};
|
||||
|
||||
}; # end inputs
|
||||
outputs = { self, nixpkgs, nix-darwin, home-manager, nix-homebrew, genebean-omp-themes, ... }: {
|
||||
nixosConfigurations = let
|
||||
user = "gene";
|
||||
in {
|
||||
rainbow-planet = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./modules/nixos
|
||||
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, nix-darwin, home-manager, nix-homebrew, disko, genebean-omp-themes, ... }: let
|
||||
inputs = { inherit disko home-manager nixpkgs nixpkgs-unstable nix-darwin; };
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${user}.imports = [
|
||||
./modules/home-manager
|
||||
./modules/home-manager/nixos.nix
|
||||
./modules/nixos/dconf.nix
|
||||
];
|
||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
||||
};
|
||||
}
|
||||
];
|
||||
}; # end rainbow-planet
|
||||
}; # end nixosConfigurations
|
||||
|
||||
# This is only set to work with x86 macOS right now... that will need to be updated
|
||||
darwinConfigurations = let
|
||||
user = "gene.liverman";
|
||||
in {
|
||||
Blue-Rock = nix-darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-darwin";
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"python-2.7.18.6"
|
||||
];
|
||||
};
|
||||
# creates a nixos system config
|
||||
nixosSystem = system: hostName: username: nixpkgs.lib.nixosSystem {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"electron-21.4.4"
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
nix-homebrew.darwinModules.nix-homebrew
|
||||
{
|
||||
nix-homebrew = {
|
||||
# Install Homebrew under the default prefix
|
||||
enable = true;
|
||||
};
|
||||
modules = [
|
||||
./modules/nixos
|
||||
|
||||
# User owning the Homebrew prefix
|
||||
user = "${user}";
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${username}.imports = [
|
||||
./modules/home-manager
|
||||
./modules/home-manager/nixos.nix
|
||||
./modules/nixos/dconf.nix
|
||||
];
|
||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# Automatically migrate existing Homebrew installations
|
||||
autoMigrate = true;
|
||||
};
|
||||
}
|
||||
}; # end nixosSystem
|
||||
|
||||
./modules/darwin
|
||||
# creates a macOS system config
|
||||
darwinSystem = system: hostName: username: nix-darwin.lib.darwinSystem {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"python-2.7.18.6"
|
||||
];
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
nix-homebrew.darwinModules.nix-homebrew
|
||||
{
|
||||
nix-homebrew = {
|
||||
# Install Homebrew under the default prefix
|
||||
enable = true;
|
||||
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${user}.imports = [
|
||||
./modules/home-manager
|
||||
./modules/home-manager/darwin.nix
|
||||
];
|
||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
||||
};
|
||||
}
|
||||
]; # end modules
|
||||
}; # end Blue-Rock
|
||||
}; # end darwinConfigurations
|
||||
# User owning the Homebrew prefix
|
||||
user = "${username}";
|
||||
|
||||
# Automatically migrate existing Homebrew installations
|
||||
autoMigrate = true;
|
||||
};
|
||||
}
|
||||
|
||||
./modules/darwin
|
||||
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${username}.imports = [
|
||||
./modules/home-manager
|
||||
./modules/home-manager/darwin.nix
|
||||
];
|
||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
||||
};
|
||||
}
|
||||
]; # end modules
|
||||
}; # end darwinSystem
|
||||
|
||||
in {
|
||||
darwinConfigurations = {
|
||||
Blue-Rock = darwinSystem "x86_64-darwin" "Blue-Rock" "gene.liverman";
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
rainbow-planet = nixosSystem "x86_64-linux" "rainbow-planet" "gene";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue