From 1c5bed3431557109424ed7ba20186defbe321c1f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 7 Jul 2023 02:06:45 +0300 Subject: [PATCH] peter welcome to fortnite --- flake.nix | 44 ++++++++++++++++--- .../{default.nix => configuration.nix} | 0 hosts/sakotop/newconfig.nix | 4 -- packages/default.nix | 6 +++ shell.nix | 10 +++++ 5 files changed, 55 insertions(+), 9 deletions(-) rename hosts/sakotop/{default.nix => configuration.nix} (100%) delete mode 100644 hosts/sakotop/newconfig.nix create mode 100644 packages/default.nix create mode 100644 shell.nix diff --git a/flake.nix b/flake.nix index 037a6f6b..c145c2c6 100644 --- a/flake.nix +++ b/flake.nix @@ -9,14 +9,48 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, ...}@attrs: { + outputs = { self, nixpkgs, home-manager, ...}@attrs: + let + inherit (self) outputs; + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + ]; + in + rec { + + # custom packages + packages = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./packages {inherit pkgs; } + ); + # dev shell for bootstrap + devShells = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./shell.nix { inherit pkgs; } + ); + + # overlays here + overlays = import ./overlays { inherit inputs; }; + + # modules :D + nixosModules = import ./modules; + nixosConfigurations = { - # TODO(sako)::rename this sakotop = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = attrs; - modules = [ ./hosts/sakotop ]; + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/sakotop/configuration.nix + ]; }; }; + + #nixosConfigurations = { + # TODO(sako)::rename this + # sakotop = nixpkgs.lib.nixosSystem { + # system = "x86_64-linux"; + # specialArgs = attrs; + # modules = [ ./hosts/sakotop ]; + # }; + #}; }; } diff --git a/hosts/sakotop/default.nix b/hosts/sakotop/configuration.nix similarity index 100% rename from hosts/sakotop/default.nix rename to hosts/sakotop/configuration.nix diff --git a/hosts/sakotop/newconfig.nix b/hosts/sakotop/newconfig.nix deleted file mode 100644 index b64a2c7b..00000000 --- a/hosts/sakotop/newconfig.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ options, config, lib, pkgs, ...}: -{ - #TODO(sako): add stuff -} diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 00000000..8c5e9102 --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,6 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' + +{ pkgs ? (import ../nixpkgs.nix) { } }: { + # example = pkgs.callPackage ./example { }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..95259154 --- /dev/null +++ b/shell.nix @@ -0,0 +1,10 @@ +# Shell for bootstrapping flake-enabled nix and home-manager +# You can enter it through 'nix develop' or (legacy) 'nix-shell' + +{ pkgs ? (import ./nixpkgs.nix) { } }: { + default = pkgs.mkShell { + # Enable experimental features without having to specify the argument + NIX_CONFIG = "experimental-features = nix-command flakes"; + nativeBuildInputs = with pkgs; [ nix home-manager git ]; + }; +}