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
40
flake.lock
generated
40
flake.lock
generated
|
|
@ -17,6 +17,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1702569759,
|
||||||
|
"narHash": "sha256-Ze3AdEEsVZBRJ4wn13EZpV1Uubkzi59TkC4j2G9xoFI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "98ab91109716871f50ea8cb0e0ac7cc1e1e14714",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
|
|
@ -143,6 +163,22 @@
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1702539185,
|
||||||
|
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688049487,
|
"lastModified": 1688049487,
|
||||||
|
|
@ -176,11 +212,13 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"disko": "disko",
|
||||||
"genebean-omp-themes": "genebean-omp-themes",
|
"genebean-omp-themes": "genebean-omp-themes",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-homebrew": "nix-homebrew",
|
"nix-homebrew": "nix-homebrew",
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|
|
||||||
153
flake.nix
153
flake.nix
|
|
@ -4,6 +4,7 @@
|
||||||
# Where we get most of our software. Giant mono repo with recipes
|
# Where we get most of our software. Giant mono repo with recipes
|
||||||
# called derivations that say how to build software.
|
# called derivations that say how to build software.
|
||||||
nixpkgs.url = "github:nixos/nixpkgs";
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
# Controls system level software and settings including fonts
|
# Controls system level software and settings including fonts
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
|
|
@ -20,6 +21,12 @@
|
||||||
# Manage Homebrew itself
|
# Manage Homebrew itself
|
||||||
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
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
|
# My oh-my-posh theme
|
||||||
genebean-omp-themes = {
|
genebean-omp-themes = {
|
||||||
url = "github:genebean/my-oh-my-posh-themes";
|
url = "github:genebean/my-oh-my-posh-themes";
|
||||||
|
|
@ -27,78 +34,90 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
}; # end inputs
|
}; # end inputs
|
||||||
outputs = { self, nixpkgs, nix-darwin, home-manager, nix-homebrew, genebean-omp-themes, ... }: {
|
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, nix-darwin, home-manager, nix-homebrew, disko, genebean-omp-themes, ... }: let
|
||||||
nixosConfigurations = let
|
inputs = { inherit disko home-manager nixpkgs nixpkgs-unstable nix-darwin; };
|
||||||
user = "gene";
|
|
||||||
in {
|
|
||||||
rainbow-planet = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
./modules/nixos
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
# creates a nixos system config
|
||||||
{
|
nixosSystem = system: hostName: username: nixpkgs.lib.nixosSystem {
|
||||||
home-manager = {
|
pkgs = import nixpkgs {
|
||||||
useGlobalPkgs = true;
|
inherit system;
|
||||||
useUserPackages = true;
|
config = {
|
||||||
users.${user}.imports = [
|
allowUnfree = true;
|
||||||
./modules/home-manager
|
permittedInsecurePackages = [
|
||||||
./modules/home-manager/nixos.nix
|
"electron-21.4.4"
|
||||||
./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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
modules = [
|
};
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
modules = [
|
||||||
{
|
./modules/nixos
|
||||||
nix-homebrew = {
|
|
||||||
# Install Homebrew under the default prefix
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# User owning the Homebrew prefix
|
home-manager.nixosModules.home-manager
|
||||||
user = "${user}";
|
{
|
||||||
|
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
|
}; # end nixosSystem
|
||||||
autoMigrate = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
./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
|
# User owning the Homebrew prefix
|
||||||
{
|
user = "${username}";
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
# Automatically migrate existing Homebrew installations
|
||||||
useUserPackages = true;
|
autoMigrate = true;
|
||||||
users.${user}.imports = [
|
};
|
||||||
./modules/home-manager
|
}
|
||||||
./modules/home-manager/darwin.nix
|
|
||||||
];
|
./modules/darwin
|
||||||
extraSpecialArgs = { inherit genebean-omp-themes; };
|
|
||||||
};
|
home-manager.darwinModules.home-manager
|
||||||
}
|
{
|
||||||
]; # end modules
|
home-manager = {
|
||||||
}; # end Blue-Rock
|
useGlobalPkgs = true;
|
||||||
}; # end darwinConfigurations
|
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