nix-config/flake.nix

100 lines
2.3 KiB
Nix
Raw Normal View History

2022-08-07 22:50:23 -07:00
{
description = "Nix and home-manager configurations for Softinio's macbook";
2024-04-26 12:20:53 -07:00
2022-08-07 22:50:23 -07:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-18 11:31:35 -07:00
nur.url = "github:nix-community/nur";
2022-08-07 22:50:23 -07:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
outputs =
{
self,
nix-darwin,
home-manager,
nur,
nixpkgs,
...
}:
2022-08-07 22:50:23 -07:00
let
2024-05-18 11:31:35 -07:00
homeManagerConfFor =
config:
{ ... }:
{
nixpkgs.overlays = [ nur.overlay ];
imports = [ config ];
};
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
m3maxConfiguration =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [ home-manager ];
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
fonts = {
2024-07-07 19:22:52 -07:00
packages = with pkgs; [ fira-code ];
2024-05-18 11:31:35 -07:00
};
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
services.nix-daemon.enable = true;
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
nix = {
nixPath = nixpkgs.lib.mkForce [ "nixpkgs=${nixpkgs}" ];
2024-04-26 12:20:53 -07:00
2024-10-26 10:56:17 -07:00
package = pkgs.nixVersions.stable;
2024-05-18 11:31:35 -07:00
settings = {
experimental-features = "nix-command flakes";
extra-platforms = [
"x86_64-darwin"
"aarch64-darwin"
];
trusted-users = [
"root"
"salar"
];
};
distributedBuilds = false;
2024-04-26 12:20:53 -07:00
};
2024-05-18 11:31:35 -07:00
programs.fish.enable = true;
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
system.configurationRevision = self.rev or self.dirtyRev or null;
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
system.stateVersion = 4;
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
nixpkgs.hostPlatform = "aarch64-darwin";
2024-04-26 12:20:53 -07:00
2024-05-18 11:31:35 -07:00
users = {
users.salar = {
home = /Users/salar;
};
2024-04-26 12:20:53 -07:00
};
};
2024-04-26 12:20:53 -07:00
in
{
darwinConfigurations.salarm3max = nix-darwin.lib.darwinSystem {
system = "aarc64-darwin";
modules = [
m3maxConfiguration
home-manager.darwinModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.users.salar = homeManagerConfFor ./home.nix;
}
];
2024-05-18 11:31:35 -07:00
specialArgs = {
inherit nixpkgs;
};
2024-04-26 12:20:53 -07:00
};
darwinPackages = self.darwinConfigurations.salarm3max.pkgs;
defaultPackage.aarch64-darwin = self.darwinConfigurations.salarm3max.system;
2022-08-07 22:50:23 -07:00
};
}