Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some small fixes to match the new nix version. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Having deterministic fullstack in development has never been more awesome.
```
{ pkgs ? import <nixpkgs> {}
, projectName ? "myProject"
, lib ? (import <nixpkgs> {}).lib
, nix-rehash ? import <nix-rehash> }:
with pkgs.lib;
with pkgs;
with lib;

let
services = nix-rehash.reService {
Expand Down Expand Up @@ -63,9 +63,10 @@ host machine. Staging or deployments have never been easier :)

```
{ pkgs ? import <nixpkgs>
, lib ? (import <nixpkgs> {}).lib
, name ? "myProject"
, nix-rehash ? import <nix-rehash> }:
with pkgs.lib;
with lib;
with pkgs;

{
Expand All @@ -80,10 +81,10 @@ host machine. Staging or deployments have never been easier :)
}
```
- do `nix-env [-f default.nix] -i myProject-container` or build with hydra and add a channel
- start container: `sudo myProject-start-container`
- start container: `sudo myProject-container-start`
- 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`
- stop container: `sudo myProject-container-stop`
3 changes: 2 additions & 1 deletion container.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { inherit system; }
, lib ? (import <nixpkgs> { inherit system; }).lib
, lxcExtraConfig ? ""
, name
, configuration
}:
with pkgs;
with pkgs.lib;
with lib;

let
container_root = "/var/lib/containers/${name}";
Expand Down
3 changes: 2 additions & 1 deletion nix-services/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ system ? builtins.currentSystem
, lib ? (import <nixpkgs> { }).lib
, pkgs ? import <nixpkgs> {
inherit system;
# Darwin needs a few packages overrides
Expand All @@ -14,7 +15,7 @@
, name
, configuration
}:
with pkgs.lib;
with lib;

let
moduleList = [
Expand Down
4 changes: 2 additions & 2 deletions nix-services/environment.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, pkgs, ... }:
with pkgs.lib;
{ config, pkgs, lib, ... }:
with lib;
{
options = {
environment.systemPackages = mkOption {
Expand Down
6 changes: 3 additions & 3 deletions nix-services/supervisord.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, pkgs, ... }:
with pkgs.lib;
{ config, pkgs, lib, ... }:
with lib;
let
serviceOpts = { name, config, ...}: {
options = {
Expand Down Expand Up @@ -50,7 +50,7 @@ let
export PATH="${pkgs.coreutils}/bin"

# Run start scripts first
"${config.userNix.startScript}"
${config.userNix.startScript}

# Run supervisord
exec ${supervisor}/bin/supervisord -c "${config.supervisord.configFile}" $extraFlags "$@"
Expand Down
8 changes: 5 additions & 3 deletions nix-services/systemd.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{ pkgs, config, ... }:
with pkgs.lib;
{ pkgs, config, lib, ... }:
with lib;
with import <nixpkgs/nixos/modules/system/boot/systemd-unit-options.nix> {
inherit config;
inherit (pkgs) lib;
inherit lib;
};
let
eqStrings = a: b: (a+(substring 0 0 b)) == ((substring 0 0 a)+b);

services = config.systemd.services;

isOneShot = cfg: hasAttr "Type" cfg.serviceConfig && cfg.serviceConfig.Type == "oneshot";
Expand Down
4 changes: 2 additions & 2 deletions nix-services/user.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, pkgs, ... }:
with pkgs.lib;
{ config, pkgs, lib, ... }:
with lib;
{
options = {
userNix.startScripts = mkOption {
Expand Down