blob: a7071782fb206c2efe329ad72abb897a27e83a7f (
plain)
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
|
{
description = "Your new nix config";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
serpantinum.url = "github:ilyamiro/serpantinum";
spicetify-nix.url = "github:Gerg-L/spicetify-nix";
ocnix.url = "github:albertov/opencode-nix";
opencode.url = "github:sst/opencode";
osu-nixos.url = "github:notgne2/osu-nixos";
helium-flake.url = "github:oxcl/nix-flake-helium-browser";
helium-flake.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.3";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
ocnix,
osu-nixos,
opencode,
...
} @ inputs: let
mkHost = {
hostname,
username,
system ? "x86_64-linux",
modules ? [],
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules =
[
{
networking.hostName = hostname;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
ocnix.overlays.default
osu-nixos.overlay
];
users.users.${username} = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" "libvirtd" "kvm" ];
packages = [ ];
};
}
ocnix.nixosModules.opencode
home-manager.nixosModules.home-manager
./nixos/common.nix
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = {
inherit inputs hostname username;
};
home-manager.users.${username} = import ./home-manager/home.nix;
}
]
++ modules;
};
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
phosphophyllite = mkHost {
hostname = "phosphophyllite";
username = "phos";
modules = [
./hosts/phosphophyllite
];
};
diamond = mkHost {
hostname = "diamond";
username = "dia";
modules = [ ./hosts/diamond ];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"phos@phosphophyllite" = home-manager.lib.homeManagerConfiguration {
# Home-manager requires 'pkgs' instance
pkgs = nixpkgs.legacyPackages.x86_64-linux; # FIXME replace x86_64-linux with your architecture
extraSpecialArgs = {
inherit inputs;
hostname = "phosphophyllite";
username = "phos";
};
# > Our main home-manager configuration file <
modules = [./home-manager/home.nix];
};
};
};
}
|