From b9fc184323049d23bcf8a685169537c75847c659 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Mon, 20 Feb 2023 20:23:05 +0100 Subject: [PATCH 1/2] Add default.nix --- default.nix | 6 ++++++ flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ 3 files changed, 28 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..80aeb433 --- /dev/null +++ b/default.nix @@ -0,0 +1,6 @@ +(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); +in fetchTarball { + url = + "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; +}) { src = ./.; }).defaultNix diff --git a/flake.lock b/flake.lock index 48ae00f0..76d05f88 100644 --- a/flake.lock +++ b/flake.lock @@ -41,6 +41,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -82,6 +98,7 @@ "inputs": { "base16": "base16", "coricamu": "coricamu", + "flake-compat": "flake-compat", "home-manager": "home-manager", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 020ee98b..971473df 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,11 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; }; outputs = From e4a12fec9794370bb4e33b391debfc0023120271 Mon Sep 17 00:00:00 2001 From: DwarfMaster Date: Sat, 18 Feb 2023 09:57:26 +0100 Subject: [PATCH 2/2] Add explanations on how to install Stylix without flakes Fixes #25. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 4a13da0d..d946254a 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ install Stylix directly into your Home Manager configuration instead. This could be useful if you are on a different Linux distribution, or a NixOS machine which is managed by someone else. + ```nix { inputs = { @@ -79,6 +80,32 @@ you will need to copy the settings described below into both of your configurations, as keeping them separate means that they cannot follow each other automatically. +### Without flakes + +If you haven't enabled flakes yet or don't want to use this feature, the +`default.nix` re-exports all the flake outputs. This means that once you have a +copy of this repo, using either a local checkout, +[niv](https://github.com/nmattia/niv) or any other method, you can import it to +get the NixOS module as the `nixosModules.stylix` attribute and the Home Manager +module as the `homeManagerModules.stylix` attribute. + +```nix +let + stylix = pkgs.fetchFromGitHub { + owner = "danth"; + repo = "stylix"; + rev = "f123771bd968cd1ac34a9f655a793de9c7bce7e6"; + sha256 = "1671giqcyahxrbf7jf3r1mzj1j1rpla36fgyia7g86x7w28war2p"; + }; +in { + imports = [ stylix.homeManagerModules.stylix ]; + + stylix.image = ./wallpaper.jpg; +} + +``` +Example usage of the Home Manager module without flakes + ## Wallpaper To start theming, you need to set a wallpaper image.