move some nixos configuration to ./nixos/modules and ./nixos/configurations. try to find a good arch to conbine home-manager and nixos modules.
This commit is contained in:
parent
6be554822c
commit
64db779064
32 changed files with 534 additions and 635 deletions
147
flake.nix
147
flake.nix
|
|
@ -3,69 +3,130 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
helix = {
|
||||
url = "github:helix-editor/helix/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
wezterm = {
|
||||
url = "github:wez/wezterm/main?dir=nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
oskars-dotfiles = {
|
||||
url = "github:oskardotglobal/.dotfiles/nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
niri-flake.url = "github:sodiboo/niri-flake";
|
||||
nur = {
|
||||
url = "github:nix-community/NUR";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
niri-flake = {
|
||||
url = "github:sodiboo/niri-flake";
|
||||
};
|
||||
|
||||
nixos-cosmic = {
|
||||
url = "github:lilyinstarlight/nixos-cosmic";
|
||||
};
|
||||
|
||||
ghostty = {
|
||||
url = "github:ghostty-org/ghostty";
|
||||
};
|
||||
|
||||
nixos-hardware = {
|
||||
url = "github:NixOS/nixos-hardware/master";
|
||||
};
|
||||
|
||||
dae = {
|
||||
url = "github:daeuniverse/flake.nix";
|
||||
};
|
||||
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
nur-xddxdd = {
|
||||
url = "github:xddxdd/nur-packages?ref=master&dir=/pkgs/uncategorized";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
firefox-addons = {
|
||||
url = "git+https://gitlab.com/rycee/nur-expressions.git?dir=pkgs/firefox-addons&ref=master";
|
||||
flake = false;
|
||||
};
|
||||
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
|
||||
ghostty.url = "github:ghostty-org/ghostty";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
dae.url = "github:daeuniverse/flake.nix";
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nur,
|
||||
flake-parts,
|
||||
flake-utils,
|
||||
...
|
||||
}@inputs:
|
||||
{
|
||||
nixosConfigurations."Tytonidae" = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
modules = [
|
||||
inputs.niri-flake.nixosModules.niri
|
||||
{
|
||||
nix.settings = {
|
||||
substituters = [ "https://cosmic.cachix.org/" ];
|
||||
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
|
||||
};
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
helix = inputs.helix.packages."${system}".default;
|
||||
})
|
||||
inputs.niri-flake.overlays.niri
|
||||
let
|
||||
inherit (self) outputs;
|
||||
in
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = flake-utils.lib.defaultSystems;
|
||||
flake = {
|
||||
nix.settings = {
|
||||
# substituters shared in home-manager and nixos configuration
|
||||
substituters =
|
||||
let
|
||||
channelStore = x: "https://${x}/nix-channels/store";
|
||||
mirrors = map (x: channelStore "mirrors.${x}.edu.cn") [
|
||||
"bfsu"
|
||||
"tuna.tsinghua"
|
||||
"ustc"
|
||||
];
|
||||
cachix = x: "https://${x}.cachix.org";
|
||||
in
|
||||
nixpkgs.lib.flatten [
|
||||
mirrors
|
||||
(cachix "nix-community")
|
||||
"https://cache.nixos.org"
|
||||
(cachix "cosmic")
|
||||
];
|
||||
}
|
||||
inputs.nixos-hardware.nixosModules.asus-fx506hm
|
||||
inputs.nixos-cosmic.nixosModules.default
|
||||
nur.modules.nixos.default
|
||||
nur.legacyPackages."${system}".repos.iopq.modules.xraya
|
||||
./configuration.nix
|
||||
./hardware-configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
./users
|
||||
inputs.dae.nixosModules.dae
|
||||
];
|
||||
};
|
||||
|
||||
nixosModules.default = import ./nixos/modules;
|
||||
|
||||
overlays = {
|
||||
modifications = (import ./overlays/modifications { inherit inputs; });
|
||||
};
|
||||
|
||||
nixosConfigurations =
|
||||
let
|
||||
nixosConfigDir = ./nixos/configurations;
|
||||
|
||||
in
|
||||
nixpkgs.lib.genAttrs
|
||||
(map (f: nixpkgs.lib.removeSuffix ".nix" f) (builtins.attrNames (builtins.readDir nixosConfigDir)))
|
||||
(
|
||||
hostName:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
modules =
|
||||
[
|
||||
(
|
||||
let
|
||||
dirPath = nixosConfigDir + "/${hostName}";
|
||||
filePath = nixosConfigDir + "/${hostName}.nix";
|
||||
in
|
||||
if builtins.pathExists dirPath then dirPath else filePath
|
||||
)
|
||||
./configuration.nix
|
||||
./users
|
||||
]
|
||||
++ [
|
||||
outputs.nixosModules.default
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue