-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
134 lines (122 loc) · 4.63 KB
/
flake.nix
File metadata and controls
134 lines (122 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
description = "Nix for macOS configuration";
# format https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin";
darwin = {
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# upgrade with
# nix flake lock --update-input nixpkgs-firefox-darwin
nixpkgs-firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
mkAlias = {
url = "github:cdmistman/mkAlias";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-locked.url =
"github:NixOS/nixpkgs/1042fd8b148a9105f3c0aca3a6177fd1d9360ba5";
nix-home-manager.url = "github:torgeir/nix-home-manager";
dotfiles.url = "github:torgeir/dotfiles";
};
outputs = inputs@{ self, nixpkgs, darwin, home-manager, nix-home-manager
, dotfiles, ... }: {
darwinConfigurations."bekk-mac-03257" = darwin.lib.darwinSystem {
system = "aarch64-darwin"; # apple silicon
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.overlays = [
# pkgs.firefox-bin
inputs.nixpkgs-firefox-darwin.overlay
# use selected unstable packages with pkgs.unstable.xyz
# https://discourse.nixos.org/t/how-to-use-nixos-unstable-for-some-packages-only/36337
# "https://github.com/ne9z/dotfiles-flake/blob/d3159df136294675ccea340623c7c363b3584e0d/configuration.nix"
(final: prev: {
unstable =
import inputs.nixpkgs-unstable { system = prev.system; };
})
(final: prev: {
# pkgs.unstable-locked.<something>
unstable-locked =
import inputs.nixpkgs-locked { system = prev.system; };
})
(final: prev: {
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1468889352
mkAlias =
inputs.mkAlias.outputs.apps.${prev.system}.default.program;
})
];
}
./modules/nix-core.nix
./modules/system.nix
./modules/apps.nix
./modules/host-users.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.torgeir = import ./home;
home-manager.extraSpecialArgs = {
inherit inputs;
dotfiles = dotfiles;
# hack around nix-home-manager causing infinite recursion
isLinux = false;
};
}
];
};
# nixd = {
# eval = {
# target = {
# args = [ ];
# installable = ".#darwinConfigurations.bekk-mac-03257.system";
# };
# depth = 1;
# };
# formatting = { command = [ "nixfmt" ]; };
# options = {
# darwin = { expr = "inputs.darwin.darwinModules.simple.options"; };
# home-manager = {
# expr = "inputs.home-manager.darwinModules.home-manager.options";
# };
# nixpkgs = {
# expr = "inputs.nixpkgs.legacyPackages.aarch64-darwin.lib.options";
# };
# };
# };
#nixosModules.vm = { config, pkgs, modulesPath, ... }: {
# imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
# system.stateVersion = "23.11";
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
# services.getty.autologinUser = "test";
# users.users.test = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # enable sudo
# packages = with pkgs; [ neofetch ];
# initialPassword = "linux";
# };
# virtualisation = {
# graphics = false;
# # vmVariant.virtualisation.graphics = false;
# # useNixStoreImage = true;
# };
# environment.systemPackages = [ pkgs.vim ];
#};
## > nix run .#nixosConfigurations.linuxvm.config.system.build.vm
#nixosConfigurations."linuxvm" = nixpkgs.lib.nixosSystem {
# system = "aarch64-linux"; # using the linux-builder
# specialArgs = { };
# modules = [
# self.nixosModules.vm
# { virtualisation.host.pkgs = nixpkgs.legacyPackages.aarch64-darwin; }
# ];
#};
};
}