Something went wrong. Try again.
NixOS configuration
Something went wrong. Try again.
nix-config flake.nix
5.0 kB · 178 lines
Nix
at sway
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179{ description = "NixOS configuration";
inputs = { # Nixpkgs nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Neovim nightly overlay neovim-nightly-overlay = { url = "github:nix-community/neovim-nightly-overlay"; inputs.nixpkgs.follows = "nixpkgs"; };
# Home manager home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; };
# disko disko = { url = "github:nix-community/disko/latest"; inputs.nixpkgs.follows = "nixpkgs"; };
# lanzaboote lanzaboote = { url = "github:nix-community/lanzaboote/v1.1.0"; inputs.nixpkgs.follows = "nixpkgs"; };
# nixos-generators nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; };
# impermanence impermanence.url = "github:nix-community/impermanence";
# nixGL nixgl = { url = "github:nix-community/nixGL"; inputs.nixpkgs.follows = "nixpkgs"; };
# agenix agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; };
# Rust overlay rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; };
# tokyonight colorscheme tokyo = { url = "github:folke/tokyonight.nvim"; flake = false; };
# nix-secrets nix-secrets = { # FIXME: eventually this should be a private repo, for VM testing its # public (but on tailscale) # url = "git+ssh://git@git.ts.endless.li:2222/ed209/nix-secrets.git"; url = "git+https://git.ts.endless.li/ed209/nix-secrets.git"; };
# bacon-ls bacon-ls.url = "github:crisidev/bacon-ls";
# Ekphos ekphos.url = "github:hanebox/ekphos";
# Firefox Addon firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; };
outputs = { self, nixpkgs, home-manager, nixos-generators, ... } @ inputs: let inherit (self) outputs; # Support for multiple arch, see https://ayats.org/blog/no-flake-utils forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"]; in { # Custom pages availbe through 'nix build', 'nix shell', etc # packages = # forAllSystems (system: ./pkgs nixpkgs.legacyPackages.${system}); packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage; packages.x86_64-linux.iso-re = self.nixosConfigurations.iso-re.config.system.build.isoImage;
# Formatter for nix files, 'nix fmt' formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays overlays = import ./overlays {inherit inputs;}; # Nixos modules nixosModules = import ./modules/nixos; # Home-manager modules homeModules = import ./modules/home-manager/default.nix;
# NixOS configuration entrypoint # 'nixos-rebuild --flake .#nixos' nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [./hosts/nixos/configuration.nix]; }; iso = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/iso/iso.nix ]; }; iso-re = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/iso/iso.nix ]; }; sachiel = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/sachiel/configuration.nix ]; }; };
# Standalone home-manager configuration entrypoint # 'home-manager switch --flake .#username' homeConfigurations = { "${inputs.nix-secrets.username}" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance extraSpecialArgs = {inherit inputs outputs;}; modules = [ # Main home-manager configuration file ./home-manager/home.nix ]; }; }; # Build VM of system # 'nix build .#qcow' qcow = nixos-generators.nixosGenerate { system = "x86_64-linux"; modules = [ { # set disk size to to 20G virtualisation.diskSize = 30 * 1024; } # you can include your own nixos configuration here, i.e. ./nixos/configuration.nix home-manager.nixosModules.home-manager { home-manager.users."${inputs.nix-secrets.username}" = import ./home-manager/home.nix; home-manager.extraSpecialArgs = {inherit inputs outputs;}; } ]; format = "qcow";
specialArgs = {inherit inputs outputs;}; }; };}