mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2025-12-14 15:48:21 +01:00
Initial commit (current config)
This commit is contained in:
commit
b68ac28949
8 changed files with 744 additions and 0 deletions
58
flake.nix
Normal file
58
flake.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
description = "Lgm's NixOS Flake";
|
||||
|
||||
inputs = {
|
||||
# There are many ways to reference flake inputs.
|
||||
# The most widely used is `github:owner/name/reference`,
|
||||
# which represents the GitHub repository URL + branch/commit-id/tag.
|
||||
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# home-manager, used for managing user configuration
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-23.05";
|
||||
# The `follows` keyword in inputs is used for inheritance.
|
||||
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
|
||||
# the `inputs.nixpkgs` of the current flake,
|
||||
# to avoid problems caused by different versions of nixpkgs.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{
|
||||
nixpkgs,
|
||||
nixpkgs-stable,
|
||||
home-manager,
|
||||
...
|
||||
}: {
|
||||
nixosConfigurations.lgm-nixos = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-stable = import nixpkgs-stable {
|
||||
system = system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
secrets = import ./secrets {};
|
||||
};
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./mounts.nix
|
||||
|
||||
# make home-manager as a module of nixos
|
||||
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.lgm = import ./home.nix;
|
||||
|
||||
home-manager.extraSpecialArgs = with specialArgs; {
|
||||
inherit pkgs-stable;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue