diff --git a/flake.lock b/flake.lock index 8db08a1..e6b4004 100644 --- a/flake.lock +++ b/flake.lock @@ -45,42 +45,6 @@ "type": "github" } }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flakeCompat": { "flake": false, "locked": { @@ -117,47 +81,6 @@ "type": "github" } }, - "mnw": { - "locked": { - "lastModified": 1738852285, - "narHash": "sha256-8Y1uyE6gGHxdU0Vcx2CMg/dAmDSxJw19aAl3TKbbo54=", - "owner": "Gerg-L", - "repo": "mnw", - "rev": "6ae73dc9cb72cea17bcc2e3d4670825f483e80e8", - "type": "github" - }, - "original": { - "owner": "Gerg-L", - "repo": "mnw", - "type": "github" - } - }, - "nil": { - "inputs": { - "flake-utils": [ - "nvf", - "flake-utils" - ], - "nixpkgs": [ - "nvf", - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1732053863, - "narHash": "sha256-DCIVdlb81Fct2uwzbtnawLBC/U03U2hqx8trqTJB7WA=", - "owner": "oxalica", - "repo": "nil", - "rev": "2e24c9834e3bb5aa2a3701d3713b43a6fb106362", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "nil", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1741513245, @@ -174,80 +97,29 @@ "type": "github" } }, - "nixpkgs-lib": { + "nixpkgs-stable": { "locked": { - "lastModified": 1738452942, - "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1740303746, - "narHash": "sha256-XcdiWLEhjJkMxDLKQJ0CCivmYYCvA5MDxu9pMybM5kM=", + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d068ae5c6516b2d04562de50a58c682540de9bf", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1705050560, - "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", - "owner": "~rycee", - "repo": "nmd", - "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "type": "sourcehut" - } - }, - "nvf": { - "inputs": { - "flake-parts": "flake-parts", - "flake-utils": "flake-utils", - "mnw": "mnw", - "nil": "nil", - "nixpkgs": "nixpkgs_2", - "nmd": "nmd", - "systems": "systems_2" - }, - "locked": { - "lastModified": 1741821673, - "narHash": "sha256-zb6LlJQ6vECH1UxiDf+eJFtTP8W9iuqbCEPJjPhdMZE=", - "owner": "notashelf", - "repo": "nvf", - "rev": "06250248696fa5c44e11a89a5647d12570fc0851", - "type": "github" - }, - "original": { - "owner": "notashelf", - "repo": "nvf", - "type": "github" - } - }, "root": { "inputs": { "alejandra": "alejandra", "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nvf": "nvf" + "nixpkgs-stable": "nixpkgs-stable", + "systems": "systems" } }, "rust-analyzer-src": { @@ -267,28 +139,6 @@ "type": "github" } }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nvf", - "nil", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731983527, - "narHash": "sha256-JECaBgC0pQ91Hq3W4unH6K9to8s2Zl2sPNu7bLOv4ek=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "71287228d96e9568e1e70c6bbfa3f992d145947b", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -299,24 +149,8 @@ "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "id": "systems", + "type": "indirect" } } }, diff --git a/flake.nix b/flake.nix index ce303c0..e6cad4d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - - nvf.url = "github:notashelf/nvf"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11"; alejandra.url = "github:kamadorueda/alejandra/3.1.0"; alejandra.inputs.nixpkgs.follows = "nixpkgs"; @@ -19,47 +18,44 @@ self, nixpkgs, home-manager, - nvf, - alejandra, + systems, ... } @ inputs: let inherit (self) outputs; + + # copied from https://github.com/Misterio77/nix-config/blob/main/flake.nix + lib = nixpkgs.lib // home-manager.lib; + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs (import systems) ( + system: + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ); in { - # use "nixos", or your hostname as the name of the configuration - # it's a better practice than "default" shown in the video - + inherit lib; nixosModules = import ./modules/nixos; - homeManagerModules = import ./modules/home-manager; - packages."x86_64-linux".default = - (nvf.lib.neovimConfiguration { - pkgs = nixpkgs.legacyPackages."x86_64-linux"; - modules = [./nvf-configuration.nix]; - }) - .neovim; + formatter = forEachSystem (pkgs: pkgs.alejandra); nixosConfigurations = { - hummingbird = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; + # Main desktop for games & workstation + hummingbird = lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; modules = [ - { - environment.systemPackages = [alejandra.defaultPackage.x86_64-linux]; - } - - ./hosts/hummingbird/configuration.nix - nvf.nixosModules.default - ./nvf-configuration.nix + ./hosts/hummingbird ]; }; }; homeConfigurations = { - "luna@hummingbird" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages."x86_64-linux"; + "luna@hummingbird" = lib.homeManagerConfiguration { + pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = {inherit inputs outputs;}; modules = [ - ./home-manager/hummingbird/home.nix + ./home-manager/luna/hummingbird.nix ]; }; }; diff --git a/home-manager/hummingbird/home.nix b/home-manager/hummingbird/home.nix deleted file mode 100644 index 538acab..0000000 --- a/home-manager/hummingbird/home.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "luna"; - home.homeDirectory = "/home/luna"; - - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "24.11"; # Please read the comment before changing. - - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = [ - # # Adds the 'hello' command to your environment. It prints a friendly - # # "Hello, world!" when run. - # pkgs.hello - - # # It is sometimes useful to fine-tune packages, for example, by applying - # # overrides. You can do that directly here, just don't forget the - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of - # # fonts? - # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - - # # You can also create simple shell scripts directly inside your - # # configuration. For example, this adds a command 'my-hello' to your - # # environment: - # (pkgs.writeShellScriptBin "my-hello" '' - # echo "Hello, ${config.home.username}!" - # '') - ]; - - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/luna/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - # EDITOR = "emacs"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/home-manager/luna/common/default.nix b/home-manager/luna/common/default.nix new file mode 100644 index 0000000..fa4e8f5 --- /dev/null +++ b/home-manager/luna/common/default.nix @@ -0,0 +1,17 @@ +{ + inputs, lib, pkgs, config, outputs, ... +}: { + imports = [ + + ]; + + programs = { + home-manager.enable = true; + }; + + home = { + username = lib.mkDefault "luna"; + homeDirectory = lib.mkDefault "/home/${config.home.username}"; + stateVersion = "24.11"; + } +} \ No newline at end of file diff --git a/home-manager/luna/hummingbird.nix b/home-manager/luna/hummingbird.nix new file mode 100644 index 0000000..7ed97c7 --- /dev/null +++ b/home-manager/luna/hummingbird.nix @@ -0,0 +1,20 @@ +{ + config, + inputs, + lib, + outputs, + pkgs, + ... +}: { + + imports = [ + ./common + ]; + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + nixd # Nix LSP + alejandra # formatter + ]; +} diff --git a/hosts/hummingbird/default.nix b/hosts/hummingbird/default.nix new file mode 100644 index 0000000..187a110 --- /dev/null +++ b/hosts/hummingbird/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 2c63c08..7a73a41 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,2 +1,2 @@ { -} +} \ No newline at end of file diff --git a/nvf-configuration.nix b/nvf-configuration.nix deleted file mode 100644 index 015c7e4..0000000 --- a/nvf-configuration.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nvf = { - enable = true; - settings.vim = { - theme = { - enable = true; - name = "catppuccin"; - style = "macchiato"; - }; - - statusline.lualine.enable = true; - telescope.enable = true; - - languages = { - enableLSP = true; - enableTreesitter = true; - - nix.enable = true; - rust.enable = true; - }; - }; - }; -}