From 6a8d524cf2cf118184750d9a504726688293315e Mon Sep 17 00:00:00 2001 From: ChUrl Date: Wed, 29 Jun 2022 19:22:33 +0200 Subject: [PATCH] Restructure Directories --- flake.lock | 6 +++--- flake.nix | 4 ++-- home.nix => home/home.nix | 4 +++- nixos/cachix.nix | 13 +++++++++++++ nixos/cachix/nix-community.nix | 11 +++++++++++ configuration.nix => nixos/configuration.nix | 3 +++ .../hardware-configuration.nix | 0 7 files changed, 35 insertions(+), 6 deletions(-) rename home.nix => home/home.nix (98%) create mode 100644 nixos/cachix.nix create mode 100644 nixos/cachix/nix-community.nix rename configuration.nix => nixos/configuration.nix (99%) rename hardware-configuration.nix => nixos/hardware-configuration.nix (100%) diff --git a/flake.lock b/flake.lock index 2ad8e88e..69831fed 100644 --- a/flake.lock +++ b/flake.lock @@ -84,11 +84,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1656239181, - "narHash": "sha256-wW1xRFBn376yGloXZ4QzBE4hjipMawpV18Lshd9QSPw=", + "lastModified": 1656372800, + "narHash": "sha256-1u9SDLXvKix/QejNb2sY2J2QZXnbe/14MnLtn+ln9j0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5", + "rev": "020c74014b9e2fa905bb4059c979965816cd9118", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 85097281..fa5cf5da 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ system = "x86_64-linux"; # >> Main NixOS configuration file << - modules = [ ./configuration.nix ]; + modules = [ ./nixos/configuration.nix ]; # Make our inputs available to the config (for importing modules) specialArgs = { inherit inputs; }; @@ -60,7 +60,7 @@ modules = [ # >> Main HomeManager configuration file << - ./home.nix + ./home/home.nix { home = rec { username = "christoph"; diff --git a/home.nix b/home/home.nix similarity index 98% rename from home.nix rename to home/home.nix index 9ea7e649..1f3f7ef9 100644 --- a/home.nix +++ b/home/home.nix @@ -30,6 +30,8 @@ nix-direnv.enable = true; }; + exa.enable = true; + # TODO: Copy config from Arch dots fish = { enable = true; @@ -83,7 +85,6 @@ # Add stuff for your user as you see fit: home.packages = with pkgs; [ # CLI Tools - # HM exa procs tokei rsync @@ -126,6 +127,7 @@ xdotool # Web + noisetorch discord yt-dlp spotify diff --git a/nixos/cachix.nix b/nixos/cachix.nix new file mode 100644 index 00000000..88b2f08a --- /dev/null +++ b/nixos/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.binaryCaches = ["https://cache.nixos.org/"]; +} diff --git a/nixos/cachix/nix-community.nix b/nixos/cachix/nix-community.nix new file mode 100644 index 00000000..427a518b --- /dev/null +++ b/nixos/cachix/nix-community.nix @@ -0,0 +1,11 @@ + +{ + nix = { + binaryCaches = [ + "https://nix-community.cachix.org" + ]; + binaryCachePublicKeys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; +} diff --git a/configuration.nix b/nixos/configuration.nix similarity index 99% rename from configuration.nix rename to nixos/configuration.nix index 16d098c2..17334166 100644 --- a/configuration.nix +++ b/nixos/configuration.nix @@ -8,6 +8,9 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + + # NixCommunity binary cache + ./cachix.nix ]; # Enable flakes diff --git a/hardware-configuration.nix b/nixos/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to nixos/hardware-configuration.nix