Skip to content

Commit

Permalink
Added an example flake and added mention of the flake in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgenkaff committed Sep 1, 2024
1 parent 67429cc commit eb72aae
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Binary packages for Linux, macOS and Windows are available on the [release page]

[release page]: https://github.com/agateau/nanonote/releases

It is also possible to install it as a flake. See the [example](nix/example.nix) in the nix folder.

## Tips and tricks

Even if Nanonote has a minimalist user interface, it comes with some handy shortcuts. Learn more about them from the [tips and tricks page](docs/tips.md).
Expand Down
59 changes: 59 additions & 0 deletions nix/example.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
description = "An example flake for Nanonote";

# This example flake does probably not work. But it should make it clear how to add Nanonote
# to your system flake, to be able to install Nanonote on your nix system.

inputs = {

# General nixos inputs:
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";

# Home-mamanger inputs
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";

# Adding the nanonote flake input
nanonote.url = "github:Morgenkaff/nanonote/add-flake?dir=nix";

};

outputs = { self, nixpkgs, home-manager, nanonote, ... }@inputs:

let

system = "x86_64-linux";

in {
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [

# Create an overlay to install Nanonote as was it part of nixpkgs
({ nixpkgs.overlays = [ nanonote.overlays.default ]; })
# And then install it under "environment.systemPackages" in your nix configuration


# Nix cinfiguration
./configuration.nix

# Home-manager config:
home-manager.nixosModules.home-manager
{

# Alternatively create n overlay for use in Home-manager
nixpkgs.overlays = [ nanonote.overlays.default ];
# And then install it under "home.packages" in you Home-manager configuration

home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.user = import ./home-manager.nix;

}
};
};
};
}

0 comments on commit eb72aae

Please sign in to comment.