mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 05:02:10 +00:00
linux init
This commit is contained in:
parent
8ed16afd7d
commit
24b16cba14
13 changed files with 338 additions and 209 deletions
44
flake.nix
44
flake.nix
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "Rathi's macOS nix-darwin + Home Manager config";
|
||||
description = "Rathi's macOS nix-darwin + Linux Home Manager config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
|
@ -38,18 +38,28 @@
|
|||
nix-homebrew,
|
||||
...
|
||||
}: let
|
||||
system = "aarch64-darwin";
|
||||
darwinSystem = "aarch64-darwin";
|
||||
linuxSystem = "x86_64-linux";
|
||||
username = "rathi";
|
||||
hostname = "hari-macbook-pro";
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
darwinHostname = "hari-macbook-pro";
|
||||
linuxHostname = "workstation";
|
||||
darwinPkgs = import nixpkgs {system = darwinSystem;};
|
||||
linuxPkgs = import nixpkgs {
|
||||
system = linuxSystem;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
formatter.${system} = pkgs.alejandra;
|
||||
formatter.${darwinSystem} = darwinPkgs.alejandra;
|
||||
formatter.${linuxSystem} = linuxPkgs.alejandra;
|
||||
|
||||
darwinConfigurations.${hostname} = nix-darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
specialArgs = {inherit inputs self username hostname;};
|
||||
darwinConfigurations.${darwinHostname} = nix-darwin.lib.darwinSystem {
|
||||
system = darwinSystem;
|
||||
specialArgs = {
|
||||
inherit inputs self username;
|
||||
hostname = darwinHostname;
|
||||
};
|
||||
modules = [
|
||||
./hosts/${hostname}
|
||||
./hosts/${darwinHostname}
|
||||
home-manager.darwinModules.home-manager
|
||||
nix-homebrew.darwinModules.nix-homebrew
|
||||
{
|
||||
|
|
@ -57,7 +67,10 @@
|
|||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {inherit inputs self username hostname;};
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs self username;
|
||||
hostname = darwinHostname;
|
||||
};
|
||||
home-manager.backupFileExtension = "hm-bak";
|
||||
home-manager.users.${username} = import ./home;
|
||||
|
||||
|
|
@ -70,5 +83,16 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations.${linuxHostname} = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = linuxPkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs self username;
|
||||
hostname = linuxHostname;
|
||||
};
|
||||
modules = [
|
||||
./hosts/${linuxHostname}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue