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

init programs.gns3 #270005

Closed
wants to merge 1 commit into from
Closed

init programs.gns3 #270005

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 25, 2023

Description of changes

GNS3 is already a package, but it depends on a few other packages in order to function properly. These are now managed by the programs.gns3 option.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Priorities

Add a 👍 reaction to pull requests you find important.

@ghost ghost requested a review from anthonyroussel November 25, 2023 22:58
@github-actions github-actions bot 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/` labels Nov 25, 2023
nixos/modules/programs/gns3.nix Outdated Show resolved Hide resolved
nixos/modules/programs/gns3.nix Outdated Show resolved Hide resolved
@h7x4
Copy link
Member

h7x4 commented Nov 26, 2023

Just wondering, is this a duplicate of #252790?

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Nov 26, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Nov 26, 2023
@ghost
Copy link
Author

ghost commented Nov 26, 2023 via email

@AndersonTorres
Copy link
Member

What's the difference with "inherit(lib)"? Isn't the effect the same?

"The effect" is not the only thing that matters - even because inherit (lib) is not equivalent to with lib.

It is about control and predictability.

If you have some knowledge about Python, with lib is similar to from lib import *.
You are bringing all the functions from lib into the scope of the whole file.
On the other hand, inherit (lib) mkOption mdDoc is similar to from lib import mkOptions mdDoc, bringing only the specified functions into the scope.

Does that mean that " with maintainers; " should also be an "inherit(maintainers)"?

Ideally, with should be abolished. Copying the best practices guide:

  1. Static analysis can’t reason about the code, because it would have to actually evaluate the with'ed file to see which names are in scope.
  2. The scoping rules are not intuitive
  3. When more than one with is used, it’s not clear anymore where the names are coming from.

BTW, this is taken from the firefox programs module.

Many failures do not make a success.

#208242

@ghost
Copy link
Author

ghost commented Nov 26, 2023

Thanks @AndersonTorres for the explanation. I was not aware of the difference. nix is in dire need of a linter like clippy for rust that is run on all PRs by the CICD, but that's a topic for another time.

@h7x4 the other PR adds a systemd service for the gns3 server, which is good if you have a separate machine for the gns3 server and want to access it from clients on separate machines running the gns3 GUI client. For a local machine, a constantly running gns3 server is unnecessary.

The usecase for this PR is a user looking to have all dependencies for the GUI client and a local gns3 server.
gns3-gui starts the server when needed and stops it (configured to do so by default) when exited. The server is run with user running gns3-gui.
The GUI also has additional dependencies (a terminal emulator and telnet, and a remote desktop client for nodes that are accessible with VNC).

GNS3 is already a package, but it depends on a few other packages in order to function properly.
These are now managed by the programs.gns3 attribute.
@ghost ghost requested a review from AndersonTorres November 26, 2023 15:38
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@ghost ghost closed this by deleting the head repository Sep 3, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `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 on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants