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

nixos/hans: init #36734

Merged
merged 5 commits into from Apr 23, 2018
Merged

nixos/hans: init #36734

merged 5 commits into from Apr 23, 2018

Conversation

ghost
Copy link

@ghost ghost commented Mar 10, 2018

Motivation for this change

Add module for Hans IP over ICMP tunnel. Mostly copypaste of iodine module.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Mar 10, 2018
uid = config.ids.uids.hans;
description = "Hans daemon user";
};
users.extraGroups.hans.gid = config.ids.gids.hans;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed uid/gids should not be required since hans has no persistent files.

@Mic92 Mic92 changed the title hans module: init nixos/hans: init Mar 10, 2018
@ghost
Copy link
Author

ghost commented Mar 10, 2018

@Mic92 Fixed, thank you!

EOF
chmod 700 /run/iodined/script
'';
script = "/run/iodined/script";
Copy link
Member

@Mic92 Mic92 Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put the same script here as a string, you wrote into /run/iodined/script without any need for shebangs.

EOF
chmod 700 /run/iodine/${name}-script
'';
script = "/run/iodine/${name}-script";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

EOF
chmod 700 /run/hans/script
'';
script = "/run/hans/script";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

#!/bin/sh
${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.extraConfig} -c ${cfg.server} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}
EOF
chmod 700 /run/hans/${name}-script
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@ghost
Copy link
Author

ghost commented Mar 28, 2018

@Mic92 Thanks!

type = types.bool;
default = false;
description = "Respond to ordinary pings";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this option belongs in this module. We also have networking.firewall.allowPing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. You're right. 👍

@matthewbauer matthewbauer merged commit 14e66c1 into NixOS:master Apr 23, 2018
@ghost
Copy link
Author

ghost commented Apr 23, 2018

@matthewbauer Thank you!

@ghost ghost deleted the hans branch April 23, 2018 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants