All Projects → kiberpipa → Nix Rehash

kiberpipa / Nix Rehash

Nix development utils that will blow up your mind

Labels

Projects that are alternatives of or similar to Nix Rehash

Life
A Nix configuration for macOS and Linux
Stars: ✭ 25 (-39.02%)
Mutual labels:  nix
Fenix
Rust nightly toolchains and rust analyzer nightly for nix [[email protected]]
Stars: ✭ 29 (-29.27%)
Mutual labels:  nix
Nix Flakes Installer
A temporary place to host Nix Flakes releases, until the NixOS project publishes official releases.
Stars: ✭ 34 (-17.07%)
Mutual labels:  nix
Nixops
NixOps is a tool for deploying to NixOS machines in a network or cloud.
Stars: ✭ 838 (+1943.9%)
Mutual labels:  nix
Nix Cabal Stack Skeleton
Skeleton project that builds with any of the three major build tools.
Stars: ✭ 15 (-63.41%)
Mutual labels:  nix
Postgrest Sessions Example
An example on how to implement session-based authentication with PostgREST
Stars: ✭ 30 (-26.83%)
Mutual labels:  nix
Nixsap
Stars: ✭ 23 (-43.9%)
Mutual labels:  nix
Nix Home
Nix home environment
Stars: ✭ 38 (-7.32%)
Mutual labels:  nix
Nix2aci
Machinery for creating and running ACIs on Linux systems where Nix(OS) and rkt are available
Stars: ✭ 21 (-48.78%)
Mutual labels:  nix
Nixlisp
Stars: ✭ 33 (-19.51%)
Mutual labels:  nix
Haskell Nix
Nix and Haskell in production
Stars: ✭ 860 (+1997.56%)
Mutual labels:  nix
Notes
ideas and planning on how to use IPFS together with Nix/OS
Stars: ✭ 15 (-63.41%)
Mutual labels:  nix
Nixos Config
NixOS configurations for server and desktop systems, including user specific config. with Home Manager
Stars: ✭ 30 (-26.83%)
Mutual labels:  nix
Configs
My configuration files
Stars: ✭ 26 (-36.59%)
Mutual labels:  nix
Nixdroid
building aosp roms (e.g. LineageOS) with nix. because why not?
Stars: ✭ 34 (-17.07%)
Mutual labels:  nix
Nix Haskell Hls
Nix builds of Haskell Language Server
Stars: ✭ 24 (-41.46%)
Mutual labels:  nix
Nur Packages Template
A template for NUR repositories: [[email protected]]
Stars: ✭ 29 (-29.27%)
Mutual labels:  nix
Flake Compat
Stars: ✭ 41 (+0%)
Mutual labels:  nix
Nix Query Tree Viewer
GTK viewer for the output of `nix-store --query --tree`
Stars: ✭ 36 (-12.2%)
Mutual labels:  nix
Nix Examples
Showcase of Nix usage for various technologies
Stars: ✭ 31 (-24.39%)
Mutual labels:  nix

========== nix-rehash

Nix development utils that will blow up your mind

reService - [email protected]

reService takes your nixos config of services and creates user-enabled supervisord config that you can use for development or deployment on non nixos systems. Having deterministic fullstack in development has never been more awesome.

  • Create default.nix

    { pkgs ? import <nixpkgs> {}
    , projectName ? "myProject"
    , nix-rehash ? import <nix-rehash> }:
      with pkgs.lib;
      with pkgs;
    
    let
      services = nix-rehash.reService {
        name = "${projectName}";
        configuration = let servicePrefix = "/tmp/${projectName}/services"; in [
          ({ config, pkgs, ...}: {
            services.postgresql.enable = true;
            services.postgresql.package = pkgs.postgresql92;
            services.postgresql.dataDir = "${servicePrefix}/postgresql";
          })
        ];
      };
    in myEnvFun {
      name = projectName;
      buildInputs = [ services ];
    }
    
  • install nix-env -f default.nix -i

  • load environemnt load-env-myProject

  • start services myProject-start-services, control services myProject-control-services, stop services myProject-stop-services

Now build this with hydra and pass the environment around :)

Alternative using nix-shell:

  • set buildInputs = [ services.config.supervisord.bin ];
  • run nix-shell
  • use supervisord and supervisorctl as you wish

reContain - [email protected]

reContain makes nixos enabled installable container that can auto-update itself. Now you can build container on hydra and auto update it on host machine. Staging or deployments have never been easier :)

  • Create default.nix

    { pkgs ? import <nixpkgs>
    , name ? "myProject"
    , nix-rehash ? import <nix-rehash> }:
      with pkgs.lib;
      with pkgs;
    
    {
      container = nix-rehash.reContain {
        inherit name;
        configuration = [{
        services.openssh.enable = true;
        services.openssh.ports = [ 25 ];
        users.extraUsers.root.openssh.authorizedKeys.keys = [ (builtins.readFile ./id_rsa.pub) ];
        }];
      };
    }
    
  • do nix-env [-f default.nix] -i myProject-container or build with hydra and add a channel

  • start container: sudo myProject-start-container

  • ssh to container: ssh localhost -p 25

  • enable auto updates with cron:

    * * * * * nix-env -i myProject-container && sudo $HOME/.nix-profile/bin/myProject-update-container
    
  • stop container: sudo myProject-stop-container

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].